Live example: mysql> show status like 'Handler%'; +-----------------------+-------+ | Variable_name | Value | +-----------------------+-------+ | Handler_commit | 0 | | Handler_delete | 0 | | Handler_discover | 0 | | Handler_read_first | 2 | | Handler_read_key | 0 | | Handler_read_next | 0 | | Handler_read_prev | 0 | | Handler_read_rnd | 0 | | Handler_read_rnd_next | 56 | | Handler_rollback | 0 | | Handler_update | 0 | | Handler_write | 0 | +-----------------------+-------+ 12 rows in set (0.00 sec) mysql> SELECT m.id, m.thread_id, m.thread_count, m.rating, m.thread_count, thread_rating FROM fMessages2 m USE INDEX (thread_count_idx) WHERE m.board_name='26247' AND m.pid = 0 AND m.status & -214783648 = 0 AND m.options & 1 = 0 AND (m.rating_bucket = 3) ORDER BY m.thread_count DESC, m.id DESC LIMIT 0, 21; +--------+-----------+--------------+-----------------+--------------+-----------------+ | id | thread_id | thread_count | rating | thread_count | thread_rating | +--------+-----------+--------------+-----------------+--------------+-----------------+ | 447580 | 447580 | 232 | 3.2242857142857 | 232 | 3.1689142385535 | | 5299 | 5299 | 228 | 2.76 | 228 | 3.1985655375109 | | 1370 | 1370 | 214 | 2.6184337349398 | 214 | 3.2189562320416 | | 5109 | 5109 | 174 | 3.47875 | 174 | 3.1568782964149 | | 3054 | 3054 | 163 | 2.6638461538462 | 163 | 3.2336827774269 | | 5687 | 5687 | 148 | 2.6858241758242 | 148 | 3.182986532119 | | 2210 | 2210 | 145 | 3.4211111111111 | 145 | 3.3508549824923 | | 3387 | 3387 | 143 | 3.3195238095238 | 143 | 3.2718630166141 | | 2871 | 2871 | 141 | 3.1710169491525 | 141 | 3.2198413779158 | | 3951 | 3951 | 137 | 3.49 | 137 | 3.2806287553378 | | 2733 | 2733 | 130 | 2.666862745098 | 130 | 3.2127895414948 | | 4185 | 4185 | 113 | 2.9241414141414 | 113 | 3.3174462611646 | | 756751 | 756751 | 108 | 2.6009090909091 | 108 | 3.3406876032095 | | 1612 | 1612 | 102 | 3.1479310344828 | 102 | 3.4129392711884 | | 781908 | 781908 | 98 | 2.9526229508197 | 98 | 3.2305060843553 | | 351309 | 351309 | 98 | 2.8807865168539 | 98 | 3.2985365838592 | | 4941 | 4941 | 96 | 3.3766666666667 | 96 | 3.2845985836634 | | 4418 | 4418 | 92 | 3.2972340425532 | 92 | 3.3320594519382 | | 9018 | 9018 | 88 | 3.3433333333333 | 88 | 3.3465381350083 | | 3608 | 3608 | 88 | 2.8276470588235 | 88 | 3.4338001921464 | | 755223 | 755223 | 86 | 3.41 | 86 | 3.3205476725832 | +--------+-----------+--------------+-----------------+--------------+-----------------+ 21 rows in set (0.27 sec) mysql> show status like 'Handler%'; +-----------------------+-------+ | Variable_name | Value | +-----------------------+-------+ | Handler_commit | 0 | | Handler_delete | 0 | | Handler_discover | 0 | | Handler_read_first | 2 | | Handler_read_key | 3 | | Handler_read_next | 0 | | Handler_read_prev | 0 | | Handler_read_rnd | 0 | | Handler_read_rnd_next | 56 | | Handler_rollback | 0 | | Handler_update | 0 | | Handler_write | 0 | +-----------------------+-------+ 12 rows in set (0.00 sec) mysql> SELECT m.id, m.thread_id, m.thread_count, m.rating, m.thread_count, thread_rating FROM fMessages2 m USE INDEX (thread_count_idx) WHERE m.board_name='26247' AND m.pid = 0 AND m.status & -214783648 = 0 AND m.options & 1 = 0 AND (m.rating_bucket = 3) ORDER BY m.thread_count ASC, m.id ASC LIMIT 0, 21; +--------+-----------+--------------+-----------------+--------------+-----------------+ | id | thread_id | thread_count | rating | thread_count | thread_rating | +--------+-----------+--------------+-----------------+--------------+-----------------+ | 765391 | 765391 | 1 | 2.5655555555556 | 1 | 2.5655555555556 | | 765392 | 765392 | 1 | 3.4291919191919 | 1 | 3.4291919191919 | | 765394 | 765394 | 1 | 2.8689743589744 | 1 | 2.8689743589744 | | 765395 | 765395 | 1 | 2.6820430107527 | 1 | 2.6820430107527 | | 765397 | 765397 | 1 | 3.0678947368421 | 1 | 3.0678947368421 | | 765398 | 765398 | 1 | 2.698679245283 | 1 | 2.698679245283 | | 765399 | 765399 | 1 | 2.9310526315789 | 1 | 2.9310526315789 | | 765401 | 765401 | 1 | 3.49 | 1 | 3.49 | | 765403 | 765403 | 1 | 2.7552830188679 | 1 | 2.7552830188679 | | 765406 | 765406 | 1 | 3.3012087912088 | 1 | 3.3012087912088 | | 765407 | 765407 | 1 | 3.4256626506024 | 1 | 3.4256626506024 | | 765409 | 765409 | 1 | 2.9544444444444 | 1 | 2.9544444444444 | | 765413 | 765413 | 1 | 3.2978787878788 | 1 | 3.2978787878788 | | 765416 | 765416 | 1 | 3.46 | 1 | 3.46 | | 765426 | 765426 | 1 | 3.26 | 1 | 3.26 | | 765429 | 765429 | 1 | 3.4418181818182 | 1 | 3.4418181818182 | | 765431 | 765431 | 1 | 2.6749484536082 | 1 | 2.6749484536082 | | 765432 | 765432 | 1 | 2.916976744186 | 1 | 2.916976744186 | | 765440 | 765440 | 1 | 2.6589361702128 | 1 | 2.6589361702128 | | 765445 | 765445 | 1 | 2.5921917808219 | 1 | 2.5921917808219 | | 765450 | 765450 | 1 | 2.8433333333333 | 1 | 2.8433333333333 | +--------+-----------+--------------+-----------------+--------------+-----------------+ 21 rows in set (1.79 sec) mysql> show status like 'Handler%'; +-----------------------+-------+ | Variable_name | Value | +-----------------------+-------+ | Handler_commit | 0 | | Handler_delete | 0 | | Handler_discover | 0 | | Handler_read_first | 2 | | Handler_read_key | 6 | | Handler_read_next | 64315 | | Handler_read_prev | 0 | | Handler_read_rnd | 0 | | Handler_read_rnd_next | 56 | | Handler_rollback | 0 | | Handler_update | 0 | | Handler_write | 0 | +-----------------------+-------+ 12 rows in set (0.00 sec) mysql> mysql> show create table fMessages2 \G *************************** 1. row *************************** Table: fMessages2 Create Table: CREATE TABLE `fMessages2` ( `board_name` varchar(6) NOT NULL default '', `id` int(11) NOT NULL default '0', `parent_id` int(11) NOT NULL default '0', `thread_id` int(11) NOT NULL default '0', `cat_id` int(11) NOT NULL default '0', `creator` varchar(128) NOT NULL default '', `del_yuid` varchar(128) NOT NULL default '', `create_ip` int(11) NOT NULL default '0', `create_time` datetime NOT NULL default '0000-00-00 00:00:00', `status` int(11) NOT NULL default '0', `mod_time` datetime NOT NULL default '0000-00-00 00:00:00', `creator_name` varchar(128) NOT NULL default '', `title` text NOT NULL, `folder_id` int(11) NOT NULL default '0', `options` int(11) NOT NULL default '0', `rating` double NOT NULL default '0', `thread_count` int(11) NOT NULL default '0', `reply_count` int(11) NOT NULL default '0', `contents` blob NOT NULL, `mesg_level` int(11) NOT NULL default '0', `mesg_path_rest` text NOT NULL, `mesg_path_first` varchar(64) NOT NULL default '', `thread_rating` double NOT NULL default '0', `rating_bucket` tinyint(4) NOT NULL default '0', `reply_id` int(11) NOT NULL default '0', `pid` tinyint(1) NOT NULL default '1', PRIMARY KEY (`board_name`,`id`), KEY `thread_idx` (`board_name`,`thread_id`,`mesg_path_first`), KEY `rating_idx` (`board_name`,`thread_id`,`rating`,`id`), KEY `thread_rating_idx` (`board_name`,`pid`,`thread_rating`,`id`), KEY `thread_count_idx` (`board_name`,`pid`,`rating_bucket`,`thread_count`,`id`), KEY `reply_idx` (`board_name`,`pid`,`rating_bucket`,`reply_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 1 row in set (1.25 sec) mysql> show table status like 'fMessages2' \G *************************** 1. row *************************** Name: fMessages2 Engine: InnoDB Version: 7 Row_format: Dynamic Rows: 42520708 Avg_row_length: 549 Data_length: 23351787520 Max_data_length: NULL Index_length: 9688842240 Data_free: 0 Auto_increment: NULL Create_time: 2006-02-23 08:33:31 Update_time: NULL Check_time: NULL Collation: latin1_swedish_ci Checksum: NULL Create_options: Comment: InnoDB free: 73792512 kB 1 row in set (1.25 sec) mysql>