Last active
December 17, 2015 13:49
-
-
Save krusty/5620521 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
MariaDB []> create table test (a int, b int) | |
-> ; | |
Query OK, 0 rows affected (0.33 sec) | |
MariaDB []> create index test1 on test (a) | |
-> ; | |
Query OK, 0 rows affected (0.15 sec) | |
Records: 0 Duplicates: 0 Warnings: 0 | |
MariaDB []> explain select * from test where a=1 | |
-> ; | |
+------+-------------+-------+------+---------------+-------+---------+-------+------+-------+ | |
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | | |
+------+-------------+-------+------+---------------+-------+---------+-------+------+-------+ | |
| 1 | SIMPLE | test | ref | test1 | test1 | 5 | const | 1 | | | |
+------+-------------+-------+------+---------------+-------+---------+-------+------+-------+ | |
1 row in set (0.08 sec) | |
MariaDB []> explain select * from test where a=1 and b=2; | |
+------+-------------+-------+------+---------------+-------+---------+-------+------+-------------+ | |
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | | |
+------+-------------+-------+------+---------------+-------+---------+-------+------+-------------+ | |
| 1 | SIMPLE | test | ref | test1 | test1 | 5 | const | 1 | Using where | | |
+------+-------------+-------+------+---------------+-------+---------+-------+------+-------------+ | |
1 row in set (0.00 sec) | |
MariaDB []> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment