DataBase 查询计划-逻辑查询优化器
Impala、ClicHouse、Hologres、OceanBase、Doris、MySQL、Presto、SnowFlake 、ADB 基本都有涉猎
一 分类 也是逻辑优化器的优化顺序
- NETSTED SUB-QUERY REWIRTE 嵌套查询的重写
- NETSTED SUB-QUERY DECOMPOSING 子查询 解压
- Split Conjunctive Predicates (条件拆分)
- Predicate Pushdown (条件下推)
- Replace Cartesian Products with Joins(operator 合并)
- Projection Pushdown (查询字段下推)
基础知识
代码语言:javascript复制SELECT s.name, e.cid
FROM student AS s, enrolled AS e
WHERE s.sid = e.sid
AND e.grade = 'A'
- T 即为一个结果
- σ 条件
- ⋈ join