Created
June 13, 2014 01:09
-
-
Save kenn/c59256c77af5fc03b241 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql> explain SELECT * FROM messages USE INDEX (index_messages_on_friend_id_and_id) WHERE friend_id = 100 AND (id < 1000000) ORDER BY id DESC LIMIT 10\G | |
*************************** 1. row *************************** | |
id: 1 | |
select_type: SIMPLE | |
table: messages | |
type: range | |
possible_keys: index_messages_on_friend_id_and_id | |
key: index_messages_on_friend_id_and_id | |
key_len: 8 | |
ref: NULL | |
rows: 183182 | |
Extra: Using where | |
1 row in set (0.00 sec) | |
mysql> explain SELECT * FROM messages USE INDEX (index_messages_on_friend_id) WHERE friend_id = 100 AND (id < 1000000) ORDER BY id DESC LIMIT 10\G | |
*************************** 1. row *************************** | |
id: 1 | |
select_type: SIMPLE | |
table: messages | |
type: ref | |
possible_keys: index_messages_on_friend_id | |
key: index_messages_on_friend_id | |
key_len: 4 | |
ref: const | |
rows: 97612 | |
Extra: Using where | |
1 row in set (0.00 sec) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment