分类: Mysql/postgreSQL
2015-03-01 11:35:55
mysql> EXPLAIN EXTENDED-> SELECT t1.a, t1.a IN (SELECT t2.a FROM t2) FROM t1\G*************************** 1. row ***************************id: 1select_type: PRIMARYtable: t1type: indexpossible_keys: NULLkey: PRIMARYkey_len: 4ref: NULLrows: 4filtered: 100.00Extra: Using index*************************** 2. row ***************************id: 2select_type: SUBQUERYtable: t2type: indexpossible_keys: akey: akey_len: 5ref: NULLrows: 3filtered: 100.00Extra: Using index2 rows in set, 1 warning (0.00 sec)mysql> SHOW WARNINGS\G*************************** 1. row ***************************Level: NoteCode: 1003Message: /* select#1 */ select `test`.`t1`.`a` AS `a`,(`test`.`t1`.`a`,`test`.`t1`.`a` in ((/* select#2 */ select `test`.`t2`.`a` from `test`.`t2` where 1 having 1 ),(`test`.`t1`.`a` in on where ((`test`.`t1`.`a` = `materialized-subquery`.`a`))))) AS `t1.aIN (SELECT t2.a FROM t2)` from `test`.`t1`1 row in set (0.00 sec)
引用在内部临时表中的列COL_NAME物化持有从结果 评价一个子查询。