Bug #1981 | Unneccessary use of filesort and temporary table when using GROUP BY | ||
---|---|---|---|
Submitted: | 28 Nov 2003 14:42 | Modified: | 11 Dec 2003 10:31 |
Reporter: | James Harvard | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: MyISAM storage engine | Severity: | S3 (Non-critical) |
Version: | 4.0.16 | OS: | MacOS (Mac OS X) |
Assigned to: | CPU Architecture: | Any |
[28 Nov 2003 14:42]
James Harvard
[28 Nov 2003 14:53]
James Harvard
I've uploaded a file with table structure & sample data for running the 'explain select ...' statements provided under 'how to repeat'.
[11 Dec 2003 10:31]
MySQL Verification Team
If there is no index on l.sale, then temporary table has to be used. Filesort can be avoided by adding ORDER BY NULL, in which case results will be unsorted. Also, EXPLAIN at this point does not know number of rows to be returned, so filesort is actually never done.