Advertisement
Guest User

Untitled

a guest
Jul 29th, 2017
460
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. MariaDB [test]> explain select * from one_k_key X, ten Y where X.a in (select max(a) from ten);
  2. +----+-------------+-------------+------+---------------+------+---------+--------------------+------+-------------------------------------------------+
  3. | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
  4. +----+-------------+-------------+------+---------------+------+---------+--------------------+------+-------------------------------------------------+
  5. | 1 | PRIMARY | Y | ALL | NULL | NULL | NULL | NULL | 10 | |
  6. | 1 | PRIMARY | <subquery2> | ALL | distinct_key | NULL | NULL | NULL | 10 | Using where; Using join buffer (flat, BNL join) |
  7. | 1 | PRIMARY | X | ref | a | a | 5 | <subquery2>.max(a) | 1 | Using index |
  8. | 2 | SUBQUERY | ten | ALL | NULL | NULL | NULL | NULL | 10 | |
  9. +----+-------------+-------------+------+---------------+------+---------+--------------------+------+-------------------------------------------------+
  10. 4 rows in set (0.00 sec)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement