Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- EXPLAIN SELECT * FROM staff WHERE department = "Cooking" AND address="Dallas";
- +------+-------------+-------+------+---------------+------+---------+------+------+-------------+
- | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
- +------+-------------+-------+------+---------------+------+---------+------+------+-------------+
- | 1 | SIMPLE | staff | ALL | NULL | NULL | NULL | NULL | 7 | Using where |
- +------+-------------+-------+------+---------------+------+---------+------+------+-------------+
- CREATE INDEX address_idx ON staff(address);
- Query OK, 0 rows affected (0.06 sec)
- Records: 0 Duplicates: 0 Warnings: 0
- EXPLAIN SELECT * FROM staff WHERE department = "Cooking" AND address="Dallas";
- +------+-------------+-------+------+---------------+-------------+---------+-------+------+------------------------------------+
- | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
- +------+-------------+-------+------+---------------+-------------+---------+-------+------+------------------------------------+
- | 1 | SIMPLE | staff | ref | address_idx | address_idx | 130 | const | 2 | Using index condition; Using where |
- +------+-------------+-------+------+---------------+-------------+---------+-------+------+------------------------------------+
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement