Bug #97001 | Dangerous optimization reconsidering_access_paths_for_index_ordering | ||
---|---|---|---|
Submitted: | 25 Sep 2019 0:35 | Modified: | 3 Apr 2020 22:41 |
Reporter: | Jeremy Cole (Basic Quality Contributor) (OCA) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S2 (Serious) |
Version: | 5.7, 5.7.27 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | Contribution, limit, Optimizer, primary key, reconsidering_access_paths_for_index_ordering |
[25 Sep 2019 0:35]
Jeremy Cole
[25 Sep 2019 0:39]
Jeremy Cole
Patch to implement reconsider_index_for_order optimizer_switch
Attachment: reconsider_index_for_order_20190924.patch.txt (text/plain), 8.20 KiB.
[25 Sep 2019 0:39]
Jeremy Cole
Test case demonstrating slow query resulting from bad optimization
Attachment: reconsider_index_for_order_bad_optimization.test (application/octet-stream, text), 2.94 KiB.
[25 Sep 2019 7:00]
MySQL Verification Team
Hello Jeremy, Thank you for the report and contribution. May I request you to please re-send the patch via "contribution" tab. Thank you. regards, Umesh
[25 Sep 2019 7:10]
MySQL Verification Team
mtr test results - 5.7.27, 5.6.45 and 8.0.17
Attachment: 97001.results (application/octet-stream, text), 12.66 KiB.
[26 Sep 2019 4:42]
MySQL Verification Team
Hello Jeremy, I'll follow up with the concern people on this. Thank you! Sincerely, Umesh
[26 Sep 2019 20:47]
Jeremy Cole
Patch to implement reconsider_index_for_order optimizer_switch (*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.
Contribution: reconsider_index_for_order_20190924.patch.txt (text/plain), 8.20 KiB.
[27 Sep 2019 4:33]
MySQL Verification Team
Thank you, Jeremy. Sincerely, Umesh
[1 Oct 2019 7:58]
Pavel Katiushyn
I've seen that many times as well. Looking forward for this fix in next release.
[14 Jan 2020 22:47]
Mark Callaghan
Domas has also encountered this problem https://dom.as/2015/07/30/on-order-by-optimization/
[3 Apr 2020 9:43]
Chaithra Marsur Gopala Reddy
Hello Jeremy. Thanks for the contribution. It is taken. Regarding the name of the optimizer switch, it is decided as "prefer_ordering_index"
[3 Apr 2020 21:41]
Jon Stephens
This is implemented in MySQL 8.0.21 as WL#13929. See same for documentation.
[3 Apr 2020 22:41]
Jeremy Cole
That's great, thanks! Just for our own planning purposes, could you clarify whether this will be backported to 5.7? (I assume not, but a man can have dreams. :))
[10 Apr 2020 22:41]
Jon Stephens
Hi Jeremy! I don't think this will be backported, and I don't know of any plans to do so.
[11 Nov 2020 13:11]
Jon Stephens
Also implemented in MySQL 5.7.33.