Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- EXPLAIN SELECT * FROM reservations WHERE no_of_guests>3;
- +------+-------------+--------------+------+---------------+------+---------+------+------+-------------+
- | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
- +------+-------------+--------------+------+---------------+------+---------+------+------+-------------+
- | 1 | SIMPLE | reservations | ALL | NULL | NULL | NULL | NULL | 6 | Using where |
- +------+-------------+--------------+------+---------------+------+---------+------+------+-------------+
- CREATE INDEX reservations_idx ON reservations(no_of_guests);
- Query OK, 0 rows affected (0.01 sec)
- Records: 0 Duplicates: 0 Warnings: 0
- EXPLAIN SELECT * FROM reservations WHERE no_of_guests>3;
- +------+-------------+--------------+-------+------------------+------------------+---------+------+------+-----------------------+
- | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
- +------+-------------+--------------+-------+------------------+------------------+---------+------+------+-----------------------+
- | 1 | SIMPLE | reservations | range | reservations_idx | reservations_idx | 5 | NULL | 1 | Using index condition |
- +------+-------------+--------------+-------+------------------+------------------+---------+------+------+-----------------------+
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement