Skip to content

Instantly share code, notes, and snippets.

Created May 25, 2013 05:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/544781523c6aebece41f to your computer and use it in GitHub Desktop.
Save anonymous/544781523c6aebece41f to your computer and use it in GitHub Desktop.
mysql> EXPLAIN SELECT Text FROM Strip_Text WHERE (Parent_Table = "Scenes" AND Parent_ID IN(SELECT Scene_ID FROM Strip_Panels WHERE Strip_ID = 1)) OR (Parent_Table = "Panels" AND Parent_ID IN(SELECT ID FROM Strip_Panels WHERE Strip_ID = 1));
+----+--------------------+--------------+-----------------+-------------------+----------+---------+-------+-------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+--------------------+--------------+-----------------+-------------------+----------+---------+-------+-------+-------------+
| 1 | PRIMARY | Strip_Text | ALL | Parent_Table | NULL | NULL | NULL | 10098 | Using where |
| 3 | DEPENDENT SUBQUERY | Strip_Panels | unique_subquery | PRIMARY,Strip_ID | PRIMARY | 8 | func | 1 | Using where |
| 2 | DEPENDENT SUBQUERY | Strip_Panels | ref | Strip_ID,Scene_ID | Strip_ID | 8 | const | 4 | Using where |
+----+--------------------+--------------+-----------------+-------------------+----------+---------+-------+-------+-------------+
3 rows in set (0.90 sec)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment