Created
October 6, 2014 16:35
-
-
Save glappen/6a3bedefc375b3c18227 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql> explain SELECT COUNT(*) FROM `transactions` WHERE `transactions`.`transaction_type_id` = 1 AND (device_id IN (182)) AND (`transactions`.`created_at` BETWEEN '2014-09-21 15:37:00' AND '2014-10-07 15:37:00'); | |
+----+-------------+--------------+-------------+------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+---------+------+-------+---------------------------------------------------------------------------------------------------------+ | |
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | | |
+----+-------------+--------------+-------------+------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+---------+------+-------+---------------------------------------------------------------------------------------------------------+ | |
| 1 | SIMPLE | transactions | index_merge | index_transactions_on_transaction_type_id,index_transactions_on_device_id,index_transactions_on_created_at | index_transactions_on_device_id,index_transactions_on_transaction_type_id | 5,5 | NULL | 19232 | Using intersect(index_transactions_on_device_id,index_transactions_on_transaction_type_id); Using where | | |
+----+-------------+--------------+-------------+------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+---------+------+-------+---------------------------------------------------------------------------------------------------------+ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment