Bug #108136 | NO_SEMIJOIN hint doesn't work | ||
---|---|---|---|
Submitted: | 15 Aug 2022 1:58 | Modified: | 17 Aug 2022 3:22 |
Reporter: | Brian Yue (OCA) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S3 (Non-critical) |
Version: | 8.0.29 | OS: | Any (rhel-7.4) |
Assigned to: | CPU Architecture: | Any (x86-64) |
[15 Aug 2022 1:58]
Brian Yue
[15 Aug 2022 7:51]
Øystein Grøvlen
Not that the hint needs to be applied to the subquery: mysql> explain select * from t1 where c1 in (select /*+ NO_SEMIJOIN() */ c1 from t2); +----+--------------------+-------+------------+----------------+---------------+------+---------+------+------+----------+--------------------------+ | id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra | +----+--------------------+-------+------------+----------------+---------------+------+---------+------+------+----------+--------------------------+ | 1 | PRIMARY | t1 | NULL | index | NULL | c1 | 10 | NULL | 5 | 100.00 | Using where; Using index | | 2 | DEPENDENT SUBQUERY | t2 | NULL | index_subquery | c1 | c1 | 5 | func | 1 | 100.00 | Using index | +----+--------------------+-------+------------+----------------+---------------+------+---------+------+------+----------+--------------------------+ Or: > explain select /*+ NO_SEMIJOIN(@subq) */ * from t1 where c1 in (select /*+ QB_NAME(subq) */c1 from t2); +----+--------------------+-------+------------+----------------+---------------+------+---------+------+------+----------+--------------------------+ | id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra | +----+--------------------+-------+------------+----------------+---------------+------+---------+------+------+----------+--------------------------+ | 1 | PRIMARY | t1 | NULL | index | NULL | c1 | 10 | NULL | 5 | 100.00 | Using where; Using index | | 2 | DEPENDENT SUBQUERY | t2 | NULL | index_subquery | c1 | c1 | 5 | func | 1 | 100.00 | Using index | +----+--------------------+-------+------------+----------------+---------------+------+---------+------+------+----------+--------------------------+
[16 Aug 2022 12:38]
MySQL Verification Team
Hi Mr. Yue, Please, let us know whether this hint works when it is applied to the nested query. Thanks in advance.
[17 Aug 2022 3:22]
Brian Yue
Hello, This hint does work when it is applied to the nested query. Thanks a lot. Now this bug report is closed.
[17 Aug 2022 12:20]
MySQL Verification Team
Thank you, Mr. Yue.