本章将解释一些关键的逻辑重写,帮助你理解 TiDB 如何生成最终的查询计划。例如,当你在 TiDB 中执行 select * from t where t.a in (select t1.a from t1 where t1.b=t.b) 查询时,你会发现 IN 子查询 t.a in (select t1.a from t1 where t1.b=t.b) 并不存在,因为 TiDB 在此进行了重写。
select * from t where t.a in (select t1.a from t1 where t1.b=t.b)
IN
t.a in (select t1.a from t1 where t1.b=t.b)
本章介绍了以下关键重写: