Bug #49200 | Select_type in explain output incorrect for semijoin queries | ||
---|---|---|---|
Submitted: | 30 Nov 2009 10:19 | Modified: | 30 Nov 2009 10:30 |
Reporter: | Roy Lyseng | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S3 (Non-critical) |
Version: | 6.0 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | optimizer_switch, semijoin, subquery |
[30 Nov 2009 10:19]
Roy Lyseng
[30 Nov 2009 10:30]
Valeriy Kravchuk
Verified just as described with recent 6.0.14 from bzr on Linux: openxs@suse:/home2/openxs/dbs/6.0-code> bin/mysql -uroot test Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 6.0.14-alpha-debug Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> drop table t1; Query OK, 0 rows affected (0.00 sec) mysql> create table t1(f1 integer); Query OK, 0 rows affected (0.04 sec) mysql> insert into t1 values(1),(11); Query OK, 2 rows affected (0.01 sec) Records: 2 Duplicates: 0 Warnings: 0 mysql> prepare stmt from "explain select * from t1 where f1 in(select f1 from t1)"; Query OK, 0 rows affected (0.00 sec) Statement prepared mysql> execute stmt; +----+-------------+-------+------+---------------+------+---------+------+------+-----------------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+------+---------------+------+---------+------+------+-----------------------------+ | 1 | PRIMARY | t1 | ALL | NULL | NULL | NULL | NULL | 2 | | | 1 | PRIMARY | t1 | ALL | NULL | NULL | NULL | NULL | 2 | Using where; FirstMatch(t1) | +----+-------------+-------+------+---------------+------+---------+------+------+-----------------------------+ 2 rows in set (0.00 sec) mysql> execute stmt; +----+-------------+-------+------+---------------+------+---------+------+------+-----------------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+------+---------------+------+---------+------+------+-----------------------------+ | 1 | SIMPLE | t1 | ALL | NULL | NULL | NULL | NULL | 2 | | | 1 | SIMPLE | t1 | ALL | NULL | NULL | NULL | NULL | 2 | Using where; FirstMatch(t1) | +----+-------------+-------+------+---------------+------+---------+------+------+-----------------------------+ 2 rows in set (0.00 sec)