Bug #24341 | Performance problem when using ORDER BY in fulltext query | ||
---|---|---|---|
Submitted: | 15 Nov 2006 18:28 | Modified: | 21 Nov 2006 16:37 |
Reporter: | Friedemann Buergel | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S5 (Performance) |
Version: | 4, 5 | OS: | Any (All) |
Assigned to: | CPU Architecture: | Any | |
Tags: | fulltext, order by, sort |
[15 Nov 2006 18:28]
Friedemann Buergel
[21 Nov 2006 16:37]
Valeriy Kravchuk
Sorry, but this is a documented limitation of MySQL optimizer. Please, read the manual (http://dev.mysql.com/doc/refman/5.0/en/order-by-optimization.html): " In some cases, MySQL cannot use indexes to resolve the ORDER BY, although it still uses indexes to find the rows that match the WHERE clause. These cases include the following: ... - The key used to fetch the rows is not the same as the one used in the ORDER BY: SELECT * FROM t1 WHERE key2=constant ORDER BY key1; ..." So, even separate index on date column will not help. We have to use workarounds, like those you described.