Bug #12106 EXPLAIN shows incorrect select_type for subquery
| Submitted: | 22 Jul 2005 8:40 | Modified: | 29 Mar 2006 13:38 |
|---|---|---|---|
| Reporter: | Valeriy Kravchuk | Email Updates: | |
| Status: | Not a Bug | Impact on me: | |
| Category: | MySQL Server: Optimizer | Severity: | S3 (Non-critical) |
| Version: | 4.1.12a-nt, 5.0.9-beta-nt | OS: | Windows (XP) |
| Assigned to: | Ramil Kalimullin | CPU Architecture: | Any |
[22 Jul 2005 8:40]
Valeriy Kravchuk
[2 Aug 2005 14:43]
Tony Deigh
I think the problem is a bit deeper than just the label. If you add primary keys to Valeriy's test case: create table t1 (c integer primary key); create table t2 (c integer primary key); note that the explain shows an index scan on the outer table. This makes the performance of the query far worse than the key look-up it should be using. +----+--------------------+-------+-----------------+---------------+---------+---------+------+------+--------------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+--------------------+-------+-----------------+---------------+---------+---------+------+------+--------------------------+ | 1 | PRIMARY | t1 | index | NULL | PRIMARY | 4 | NULL | 0 | Using where; Using index | | 2 | DEPENDENT SUBQUERY | t2 | unique_subquery | PRIMARY | PRIMARY | 4 | func | 1 | Using index | +----+--------------------+-------+-----------------+---------------+---------+---------+------+------+--------------------------+
[7 Jan 2006 21:12]
Olaf van der Spek
Are there any updates on this bug? The issue is still present in 5.0.18 and it severely degrades the performance of these queries.
[29 Mar 2006 13:38]
Ramil Kalimullin
It's not a bug, this is how such subqueries are implemented now. Use 'explain extended...', then 'show warnings' to see what's happening. We have a corresponding task in the our todo list.
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.042 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.