Bug #96334 | subquery in "EXISTS (subquery)" does not use index properly | ||
---|---|---|---|
Submitted: | 26 Jul 2019 4:39 | Modified: | 29 Jul 2019 7:06 |
Reporter: | Seunguck Lee | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S3 (Non-critical) |
Version: | 8.0.16 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[26 Jul 2019 4:39]
Seunguck Lee
[26 Jul 2019 12:37]
MySQL Verification Team
Hello Mr. Lee, Thank you for your bug report. However, this is not a bug. There are two conditions in which the index can not be used. First one is when you are using expressions, like "p2.x between p1.x-9000 and p1.x+9000" and second one is when number of rows matched is higher then 1/5 or 1/4 of the total number of rows. Regarding the first query, what you were using is called "common column in the semi-join", for which the index can be used. This is all explained in our Reference Manual, chapter on "Optimizer". Not a bug.
[29 Jul 2019 7:06]
Seunguck Lee
Thanks Sinisa. >> First one is when you are using expressions, like "p2.x between p1.x-9000 and p1.x+9000" and second one is when number of rows matched is higher then 1/5 or 1/4 of the total number of rows. You mean "-9000" and "+9000" in the condition by "using expression" ? Regarding the first query, what you were using is called "common column in the semi-join", for which the index can be used. This is all explained in our Reference Manual, chapter on "Optimizer". Would you please tell me the specific URL of manual ? (I have scanned manual, but I can't find).
[29 Jul 2019 12:19]
MySQL Verification Team
Mr. Lee, You are welcome.