Skip to content
About
Main content

Time enters the planner

How do mechanisms move a decision earlier, later, or away entirely, and what does each position cost?

The first articles shared an assumption so basic that it was never stated: the decides, then execution obeys. Every mechanism in this article relaxes that assumption in one direction or the other. Time becomes an explicit variable, and the governing question is the gap between when a decision is made and when the information to make it well exists.

This is the " versus late " dial from Data reduction, now the literal subject. There are three positions on the timeline, and each mechanism in this article sits on one:

PositionMechanismWhat it buysWhat it costs
Decide earlier, reusePlan caching, prepared statements, compiled codeThe decision cost is spread over many runsThe decision is made without the information that mattered
Decide later, reviseAdaptive execution, dynamic sizingMeasurements instead of estimatesA , and determinism
Do not decide, reuse the answerResult caching, subplan memoizationThe whole computationStorage, invalidation, and a bet that the query will recur

We take them in one deliberate order. Materialization versus pipelining comes before subplan caching, because it is not a peer of the others. It is the precondition for two of them: adaptivity and cross-query sharing are bought with the same thing.

(Operator speed itself, such as how fast a vectorized scan runs, is a matter for the execution engine. Here we cover only the planner's decisions about execution.)