Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Nov 18th, 2012  |  syntax: None  |  size: 1.21 KB  |  views: 26  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. mysql> explain select id
  2.     -> from file
  3.     -> where size in
  4.     ->     (
  5.     ->     select size from
  6.     ->         (
  7.     ->         select count(*) as c, size
  8.     ->         from file
  9.     ->         group by size
  10.     ->         having c>1 and size>0
  11.     ->         ) as t
  12.     ->     );
  13. +----+--------------------+------------+-------+---------------+----------+-----
  14. ----+------+-------+--------------------------+
  15. | id | select_type        | table      | type  | possible_keys | key      | key_
  16. len | ref  | rows  | Extra                    |
  17. +----+--------------------+------------+-------+---------------+----------+-----
  18. ----+------+-------+--------------------------+
  19. |  1 | PRIMARY            | file       | index | NULL          | filesize | 8
  20.     | NULL | 21168 | Using where; Using index |
  21. |  2 | DEPENDENT SUBQUERY | <derived3> | ALL   | NULL          | NULL     | NULL
  22.     | NULL |  2813 | Using where              |
  23. |  3 | DERIVED            | file       | index | NULL          | filesize | 8
  24.     | NULL | 21168 | Using index              |
  25. +----+--------------------+------------+-------+---------------+----------+-----
  26. ----+------+-------+--------------------------+
  27. 3 rows in set (0.01 sec)