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.

CommentFileSizeAuthor
#3 filter.patch900 bytescatch

Comments

catch’s picture

Component: base system » filter.module
sun’s picture

catch’s picture

Status: Active » Needs review
StatusFileSize
new900 bytes
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 |       | 
+----+-------------+-------+-------+---------------+--------+---------+------+------+-------+
sun’s picture

Status: Needs review » Reviewed & tested by the community
dries’s picture

Status: Reviewed & tested by the community » Fixed

Nice catch. Committed to CVS HEAD. Thanks!

Status: Fixed » Closed (fixed)
Issue tags: -Performance

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