Module mz_adapter::optimize::materialized_view

source ·
Expand description

Optimizer implementation for CREATE MATERIALIZED VIEW statements.

Note that, in contrast to other optimization pipelines, timestamp selection is not part of MV optimization. Instead users are expected to separately set the as-of on the optimized DataflowDescription received from GlobalLirPlan::unapply. Reasons for choosing to exclude timestamp selection from the MV optimization pipeline are:

(a) MVs don’t support non-empty until frontiers, so they don’t provide opportunity for optimizations based on the selected timestamp. (b) We want to generate dataflow plans early during environment bootstrapping, before we have access to all information required for timestamp selection.

None of this is set in stone though. If we find an opportunity for optimizing MVs based on their timestamps, we’ll want to make timestamp selection part of the MV optimization again and find a different approach to bootstrapping.

See also MaterializeInc/materialize#22940.

Structs§

  • The (final) result after MIR ⇒ LIR lowering and optimizing the resulting DataflowDescription with LIR plans.
  • The (sealed intermediate) result after:
  • The (sealed intermediate) result after HIR ⇒ MIR lowering and decorrelation and MIR optimization.