mysql dependent subquery_DEPENDENT SUBQUERY” 和 “SUBQUERY”

mysql> EXPLAIN format=json SELECT * FROM t1 WHERE t1.a IN (SELECT c FROM t2 WHERE (SELECT e FROM t3 as t31) < SOME (SELECT e FROM t3 ast32 WHERE t1.b))\G*************************** 1. row ***************************EXPLAIN: {"query_block": {"select_id": 1,"nested_loop": [

{"table": {"table_name": "t1","access_type": "ALL","rows": 2,"filtered": 100,"attached_condition": "(((/* select#3 */ select `test`.`t31`.`e` from `test`.`t3` `t31`),(/* select#4 */ select 1 from `test`.`t3` `t32` where (`test`.`t1`.`b` and (outer_field_is_not_null, ((((/* select#3 */ select `test`.`t31`.`e` from `test`.`t3` `t31`)) < `test`.`t32`.`e`) or isnull(`test`.`t32`.`e`)), true)) having (outer_field_is_not_null, (`test`.`t32`.`e`), true))))","attached_subqueries": [

{"dependent": true,"cacheable": false,"query_block": {"select_id": 4,"table": {"table_name": "t32","access_type": "ALL","rows": 2,"filtered": 100,"attached_condition": "(`test`.`t1`.`b` and (outer_field_is_not_null, ((((/* select#3 */ select `test`.`t31`.`e` from `test`.`t3` `t31`)) < `test`.`t32`.`e`) or isnull(`test`.`t32`.`e`)), true))"}

}

},

{"dependent": false,"cacheable": true,"query_block": {"select_id": 3,"table": {"table_name": "t31","access_type": "ALL","rows": 2,"filtered": 100}

}

}

]

}

},

{"table": {"table_name": "t2","access_type": "ALL","rows": 2,"filtered": 100,"first_match": "t1","using_join_buffer": "Block Nested Loop","attached_condition": "(`test`.`t2`.`c` = `test`.`t1`.`a`)"}

}

]

}

}1 row in set, 2 warnings (0.00 sec)


版权声明:本文为weixin_28235889原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。