Bug #32341 Subquery does not use index with session variable, works with string literal
| Submitted: | 13 Nov 2007 19:29 | Modified: | 16 Oct 2008 14:35 |
|---|---|---|---|
| Reporter: | Devananda van der Veen | Email Updates: | |
| Status: | Verified | Impact on me: | |
| Category: | MySQL Server: Optimizer | Severity: | S3 (Non-critical) |
| Version: | 5.0.41, 5.0.52 | OS: | Linux |
| Assigned to: | CPU Architecture: | Any | |
| Tags: | index optimization, session variable, subquery | ||
[13 Nov 2007 19:29]
Devananda van der Veen
[13 Nov 2007 19:31]
Devananda van der Veen
SQL dump of table structures and data
Attachment: example.sql (application/octet-stream, text), 2.65 KiB.
[8 Dec 2007 19:19]
Valeriy Kravchuk
Thank you for a bug report. Verified just as described with 5.0.52.
[22 Jan 2008 21:17]
Sergey Petrunya
The query should be handled by materialization strategy (WL#1110), but at the moment it is not.
[22 Jan 2008 22:01]
Sergey Petrunya
.. because NOT IN requires NULL-aware subquery handling (see http://forge.mysql.com/worklog/task.php?id=3830), which is not yet implemented.
[22 Jan 2008 22:03]
Sergey Petrunya
Please disregard the last comment (but the one before it), posted to the wrong bug.
[26 Jun 2008 15:57]
Sergey Petrunya
The problem is that use of a session variable makes MySQL assume that subquery is "uncacheable", even if the said variable does not change during the query execution. We intend to fix this at some point, but not in MySQL 5.x. At the moment the target version is MySQL 6.x
[26 Dec 2010 14:00]
Valeriy Kravchuk
Bug #18656 was marked as a duplicate of this one.
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.065 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.