mini\Database\AstOptimizer class

Documentation

Optimizes SQL AST for correct evaluation and performance

Key transformations:

  • Rewrites negated predicates using De Morgan's laws
  • Ensures correct three-valued logic (NULL handling)

Methods (3)

Optimize an AST node and its children

Rewrite negated predicates using De Morgan's laws

Flip a comparison operator for NOT transformation

Source

src/Database/AstOptimizer.php:23-226