Bug #22781 | SQL_BIG_RESULT fails to influence sort plan | ||
---|---|---|---|
Submitted: | 28 Sep 2006 14:51 | Modified: | 20 Jun 2010 22:35 |
Reporter: | John David Duncan | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S2 (Serious) |
Version: | 5.0.24/5.0BK | OS: | Any |
Assigned to: | Georgi Kodinov | CPU Architecture: | Any |
[28 Sep 2006 14:51]
John David Duncan
[28 Sep 2006 16:14]
MySQL Verification Team
Thank you for the bug report. Verified as described changing some copy-paste mistakes in the test case.
[30 Sep 2006 11:15]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/12897 ChangeSet@1.2293, 2006-09-30 14:14:40+03:00, gkodinov@macbook.local +8 -0 Bug #22781: SQL_BIG_RESULT fails to influence sort plan There is a check for SQL_BIG_RESULT at compile time that will disable using the index for GROUP BY. However on executuon time this is re-checked to account for the additional optimizations made inbetween. So we must disable skiping the sort order for GROUP BY also at execution time if SQL_BIG_RESULT is on.
[9 Oct 2006 15:58]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/13340 ChangeSet@1.2293, 2006-10-09 19:51:41+04:00, gkodinov@macbook.local +8 -0 Bug #22781: SQL_BIG_RESULT fails to influence sort plan Currently SQL_BIG_RESULT is checked only at compile time. However, additional optimizations may take place after this check that change the sort method from 'filesort' to sorting via index. As a result the actual plan executed is not the one specified by the SQL_BIG_RESULT hint. Similarly, there is no such test when executing EXPLAIN, resulting in incorrect output. The patch corrects the problem by testing for SQL_BIG_RESULT both during the explain and execution phases.
[21 Oct 2006 9:15]
Georgi Kodinov
Pushed in 5.0.27/5.1.13-beta
[23 Oct 2006 14:20]
Paul DuBois
Noted in 5.0.27, 5.1.13 changelogs. Use of SQL_BIG_RESULT did not influence the sort plan for query execution.
[5 May 2010 15:12]
Bugs System
Pushed into 5.1.47 (revid:joro@sun.com-20100505145753-ivlt4hclbrjy8eye) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[6 May 2010 2:27]
Paul DuBois
Push resulted from incorporation of InnoDB tree. No changes pertinent to this bug. Re-closing.
[28 May 2010 6:02]
Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100524190136-egaq7e8zgkwb9aqi) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (pib:16)
[28 May 2010 6:30]
Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20100524190941-nuudpx60if25wsvx) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[28 May 2010 6:58]
Bugs System
Pushed into 5.5.5-m3 (revid:alik@sun.com-20100524185725-c8k5q7v60i5nix3t) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[30 May 2010 0:32]
Paul DuBois
Push resulted from incorporation of InnoDB tree. No changes pertinent to this bug. Re-closing.
[17 Jun 2010 12:05]
Bugs System
Pushed into 5.1.47-ndb-7.0.16 (revid:martin.skold@mysql.com-20100617114014-bva0dy24yyd67697) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[17 Jun 2010 12:50]
Bugs System
Pushed into 5.1.47-ndb-6.2.19 (revid:martin.skold@mysql.com-20100617115448-idrbic6gbki37h1c) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[17 Jun 2010 13:32]
Bugs System
Pushed into 5.1.47-ndb-6.3.35 (revid:martin.skold@mysql.com-20100617114611-61aqbb52j752y116) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)