filter_formats() causes a filesort

catch - November 7, 2009 - 04:38
Project:Drupal
Version:7.x-dev
Component:filter.module
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed
Issue tags:Performance
Description

EXPLAIN SELECT ff.* FROM filter_format ff ORDER BY weight ASC;
+----+-------------+-------+------+---------------+------+---------+------+------+----------------+
| id | select_type | table | type | possible_keys | key  | key_len | ref  | rows | Extra          |
+----+-------------+-------+------+---------------+------+---------+------+------+----------------+
|  1 | SIMPLE      | ff    | ALL  | NULL          | NULL | NULL    | NULL |    3 | Using filesort |
+----+-------------+-------+------+---------------+------+---------+------+------+----------------+
1 row in set (0.00 sec)

This query is currently run whenever displaying a formatted textarea, but has no index at all.

#1

catch - November 7, 2009 - 04:40
Component:base system» filter.module

#2

sun - November 7, 2009 - 04:41

#3

catch - November 7, 2009 - 06:00
Status:active» needs review

mysql> EXPLAIN SELECT ff.* FROM filter_format ff ORDER BY weight ASC;
+----+-------------+-------+-------+---------------+--------+---------+------+------+-------+
| id | select_type | table | type  | possible_keys | key    | key_len | ref  | rows | Extra |
+----+-------------+-------+-------+---------------+--------+---------+------+------+-------+
|  1 | SIMPLE      | ff    | index | NULL          | weight | 1       | NULL |    3 |       |
+----+-------------+-------+-------+---------------+--------+---------+------+------+-------+

AttachmentSizeStatusTest resultOperations
filter.patch900 bytesIdlePassed: 14677 passes, 0 fails, 0 exceptionsView details | Re-test

#4

sun - November 7, 2009 - 15:38
Status:needs review» reviewed & tested by the community

#5

Dries - November 7, 2009 - 22:15
Status:reviewed & tested by the community» fixed

Nice catch. Committed to CVS HEAD. Thanks!

#6

System Message - November 21, 2009 - 22:20
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.