Guest User

Untitled

a guest
May 23rd, 2018
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. mysql> explain SELECT * FROM user_test WHERE first_name = 'cee' AND user_id = 199559;
  2. +----+-------------+-----------+-------+--------------------------+---------+---------+-------+------+-------+
  3. | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
  4. +----+-------------+-----------+-------+--------------------------+---------+---------+-------+------+-------+
  5. | 1 | SIMPLE | user_test | const | PRIMARY,first_name_index | PRIMARY | 4 | const | 1 | NULL |
  6. +----+-------------+-----------+-------+--------------------------+---------+---------+-------+------+-------+
  7. 1 row in set (0.00 sec)
  8.  
  9. mysql> explain SELECT * FROM user_test WHERE first_name = 'cee' AND date_of_birth = '2019-10-13';
  10. +----+-------------+-----------+-------------+---------------------+-----------------------+---------+------+------+---------------------------------------------------------+
  11. | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
  12. +----+-------------+-----------+-------------+---------------------+-----------------------+---------+------+------+---------------------------------------------------------+
  13. | 1 | SIMPLE | user_test | index_merge | first_name_index, | date_of_birth_index, | 4,152 | NULL | 1 | Using intersect(date_of_birth_index,first_name_index); |
  14. | | | | | date_of_birth_index | first_name_index | | | | Using where |
  15. +----+-------------+-----------+-------------+---------------------+-----------------------+---------+------+------+---------------------------------------------------------+
  16. 1 row in set (0.00 sec)
Add Comment
Please, Sign In to add comment