Skip to main content

Module cse

Module cse 

Source
Expand description

Common-subexpression-elimination pass.

Two-level CSE:

  1. Plan-level: identical Subquery/Exists/InSubquery bodies (by canonical explain string) are hoisted into Cte + CteRef pairs.

  2. Intra-expression: repeated non-trivial subexpressions inside a Filter predicate are assigned a __cse_N alias and materialised in a new Compute node that wraps the Filter.

Structs§

CommonSubexprElimination
Extract common subexpressions into Compute bindings (intra-expression) and hoist identical subquery bodies into CTEs (plan-level).