Skip to content

Instantly share code, notes, and snippets.

@spetrunia
Created March 17, 2014 13:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spetrunia/9599260 to your computer and use it in GitHub Desktop.
Save spetrunia/9599260 to your computer and use it in GitHub Desktop.
mysql> explain extended select * from t100 where col1 < 5 order by key1 limit 10;
+------+-------------+-------+-------+---------------+------+---------+------+------+----------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
+------+-------------+-------+-------+---------------+------+---------+------+------+----------+-------------+
| 1 | SIMPLE | t100 | index | NULL | key1 | 5 | NULL | 10 | 0.99 | Using where |
+------+-------------+-------+-------+---------------+------+---------+------+------+----------+-------------+
1 row in set, 1 warning (0.00 sec)
mysql> explain extended select * from t100 where col1 > 5 order by key1 limit 10;
+------+-------------+-------+-------+---------------+------+---------+------+------+----------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
+------+-------------+-------+-------+---------------+------+---------+------+------+----------+-------------+
| 1 | SIMPLE | t100 | index | NULL | key1 | 5 | NULL | 10 | 99.01 | Using where |
+------+-------------+-------+-------+---------------+------+---------+------+------+----------+-------------+
1 row in set, 1 warning (0.00 sec)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment