Bug #1583 | Unusable ORDER BY performance | ||
---|---|---|---|
Submitted: | 17 Oct 2003 3:10 | Modified: | 24 Jul 2004 9:17 |
Reporter: | Stewart Witchalls | Email Updates: | |
Status: | No Feedback | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S2 (Serious) |
Version: | 4.0.14+ | OS: | Windows (WinNT) |
Assigned to: | Assigned Account | CPU Architecture: | Any |
[17 Oct 2003 3:10]
Stewart Witchalls
[17 Oct 2003 4:30]
Indrek Siitan
Do you have the tdate field indexed?
[17 Oct 2003 7:46]
Stewart Witchalls
Table indexes created after table: CREATE INDEX t_tid ON t( tid ); CREATE INDEX t_tdate ON t( tdate ); If indexing was the issue, would expect select without ORDER BY to also run slow.
[23 Oct 2003 1:11]
Stewart Witchalls
Forgot to mention, table contains BLOBS. The select does not retrieve them. Is it possible that the ORDER BY is pulling in the entire row?
[23 Oct 2003 4:01]
Heikki Tuuri
Hi! Yes, I think an ORDER BY really pulls in the whole row. If you have big BLOBs, it will slow down things a lot. Workaround: put BLOBs into a separate table and refer to it using a 'surrogate id', for example, an auto-inc value. We have to look into the ORDER BY optimization in the future. MySQL should not retrieve columns it does not really use in the calculation of the query results. Best regards, Heikki
[23 Oct 2003 4:04]
Stewart Witchalls
Do you a time frame for that? The tables work fine on Oracle and MSSQL. I don't really want to implement a MySQL bodge.
[29 Oct 2003 8:28]
Konstantin Osipov
Could you please provide us with the following ingormation: - EXPLAIN for this query with ORDER BY - EXPLAIN for query without ORDER BY - select count(*) from table - show create table - EXPLAIN for query with order by but without limit Thank you for your feedback.
[24 Jul 2004 9:16]
Konstantin Osipov
No feedback was provided on this bug. Feel free to reopen it if you have new informaiton.