mysql> explain SELECT * FROM bot_log WHERE channel REGEXP '.*#drupal-support( |$)' AND (timestamp >= 1219708800 AND timestamp <= 1219795200) ORDER BY id
-> ;
+----+-------------+---------+------+---------------+------+---------+------+---------+-----------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+---------+------+---------------+------+---------+------+---------+-----------------------------+
| 1 | SIMPLE | bot_log | ALL | NULL | NULL | NULL | NULL | 1785642 | Using where; Using filesort |
+----+-------------+---------+------+---------------+------+---------+------+---------+-----------------------------+
Comments
Comment #1
Morbus IffOnly a key on id, part of the problem. Needs to have channel and timestamp added.
Comment #2
Morbus IffCommitted.