Download & Extend

filter_formats() causes a filesort

Project:Drupal core
Version:7.x-dev
Component:filter.module
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed (fixed)
Issue tags:Performance

Issue Summary

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.

Comments

#1

Component:base system» filter.module

#2

#3

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

#4

Status:needs review» reviewed & tested by the community

#5

Status:reviewed & tested by the community» fixed

Nice catch. Committed to CVS HEAD. Thanks!

#6

Status:fixed» closed (fixed)

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