Module com.darkcollective.relix.optimizer


module com.darkcollective.relix.optimizer
Query optimization passes for Relix relational algebra expressions.

This module accepts a SemanticModel produced by semantic analysis and rewrites each query's RelNode tree to a semantically equivalent but more efficient form. Every transformation is logged in an OptimizationContext so the full audit trail can be rendered by the console's optimization report.

Optimization rules

Each rule is identified by a unique OptimizationCode and implements the OptimizationRule interface. Codes are grouped by a category prefix (SEL, JOIN, …); OptimizationCode is the definitive list of both the categories and the rules in them, and OptimizationPipeline declares the order they run in. Neither is restated here — a second copy of an enumerable list is a copy that drifts.

Entry point

   QueryOptimizer optimizer = new QueryOptimizer();
   List<OptimizationResult> results = optimizer.optimize(semanticModel);