| Bug #22781 | SQL_BIG_RESULT fails to influence sort plan | ||
|---|---|---|---|
| Submitted: | 28 Sep 2006 16:51 | Modified: | 23 Oct 2006 16:20 |
| Reporter: | John David Duncan | ||
| Status: | Closed | ||
| Category: | Server: Optimizer | Severity: | S2 (Serious) |
| Version: | 5.0.24/5.0BK | OS: | |
| Assigned to: | Georgi Kodinov | Target Version: | |
[28 Sep 2006 16:51]
John David Duncan
[28 Sep 2006 18:14]
Miguel Solorzano
Thank you for the bug report. Verified as described changing some copy-paste mistakes in the test case.
[30 Sep 2006 13: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 17: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 11:15]
Georgi Kodinov
Pushed in 5.0.27/5.1.13-beta
[23 Oct 2006 16: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.
