Advertisement
Guest User

Untitled

a guest
Mar 19th, 2018
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. EXPLAIN SELECT * FROM reservations WHERE no_of_guests>3;
  2. +------+-------------+--------------+------+---------------+------+---------+------+------+-------------+
  3. | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
  4. +------+-------------+--------------+------+---------------+------+---------+------+------+-------------+
  5. | 1 | SIMPLE | reservations | ALL | NULL | NULL | NULL | NULL | 6 | Using where |
  6. +------+-------------+--------------+------+---------------+------+---------+------+------+-------------+
  7.  
  8. CREATE INDEX reservations_idx ON reservations(no_of_guests);
  9. Query OK, 0 rows affected (0.01 sec)
  10. Records: 0 Duplicates: 0 Warnings: 0
  11.  
  12.  
  13. EXPLAIN SELECT * FROM reservations WHERE no_of_guests>3;
  14. +------+-------------+--------------+-------+------------------+------------------+---------+------+------+-----------------------+
  15. | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
  16. +------+-------------+--------------+-------+------------------+------------------+---------+------+------+-----------------------+
  17. | 1 | SIMPLE | reservations | range | reservations_idx | reservations_idx | 5 | NULL | 1 | Using index condition |
  18. +------+-------------+--------------+-------+------------------+------------------+---------+------+------+-----------------------+
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement