Expand description
Simplifies predicates by reducing redundant or overlapping conditions.
This module provides functionality to optimize logical predicates used in query planning
by eliminating redundant conditions, thus reducing the number of predicates to evaluate.
Unlike the simplifier in simplify_expressions/simplify_exprs.rs, which focuses on
general expression simplification (e.g., constant folding and algebraic simplifications),
this module specifically targets predicate optimization by handling containment relationships.
For example, it can simplify x > 5 AND x > 6 to just x > 6, as the latter condition
encompasses the former, resulting in fewer checks during query execution.
Functionsยง
- extract_
column_ ๐from_ expr - Extracts a column reference from an expression, if present.
- find_
most_ ๐restrictive_ predicate - Finds the most restrictive predicate from a list based on literal values.
- simplify_
column_ ๐predicates - Simplifies predicates related to a single column.
- simplify_
predicates - Simplifies a list of predicates by removing redundancies.