Skip to content

Instantly share code, notes, and snippets.

@nd
Created November 19, 2012 10:44
Show Gist options
  • Save nd/4110053 to your computer and use it in GitHub Desktop.
Save nd/4110053 to your computer and use it in GitHub Desktop.
mysql> explain select s.branch_name
from build_state s
where s.branch_name is not null
and s.id in (select h.build_state_id from history h where h.build_type_id = 'bt400' and h.build_start_time_server > 1353004041189);
+----+--------------------+-------+----------------+-------------------------------------------------------+------------------+---------+------+-------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+--------------------+-------+----------------+-------------------------------------------------------+------------------+---------+------+-------+-------------+
| 1 | PRIMARY | s | ALL | NULL | NULL | NULL | NULL | 47559 | Using where |
| 2 | DEPENDENT SUBQUERY | h | index_subquery | start_time_index,build_type_id_index,history_state_id | history_state_id | 9 | func | 1 | Using where |
+----+--------------------+-------+----------------+-------------------------------------------------------+------------------+---------+------+-------+-------------+
2 rows in set (0.00 sec)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment