Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mysql> explain SELECT * FROM user_test WHERE first_name = 'cee' AND user_id = 199559;
- +----+-------------+-----------+-------+--------------------------+---------+---------+-------+------+-------+
- | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
- +----+-------------+-----------+-------+--------------------------+---------+---------+-------+------+-------+
- | 1 | SIMPLE | user_test | const | PRIMARY,first_name_index | PRIMARY | 4 | const | 1 | NULL |
- +----+-------------+-----------+-------+--------------------------+---------+---------+-------+------+-------+
- 1 row in set (0.00 sec)
- mysql> explain SELECT * FROM user_test WHERE first_name = 'cee' AND date_of_birth = '2019-10-13';
- +----+-------------+-----------+-------------+---------------------+-----------------------+---------+------+------+---------------------------------------------------------+
- | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
- +----+-------------+-----------+-------------+---------------------+-----------------------+---------+------+------+---------------------------------------------------------+
- | 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); |
- | | | | | date_of_birth_index | first_name_index | | | | Using where |
- +----+-------------+-----------+-------------+---------------------+-----------------------+---------+------+------+---------------------------------------------------------+
- 1 row in set (0.00 sec)
Add Comment
Please, Sign In to add comment