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 optimizer 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 "early versus late binding" dial from Data reduction, now the literal subject. There are three positions on the timeline, and each mechanism in this article sits on one:
| Position | Mechanism | What it buys | What it costs |
|---|---|---|---|
| Decide earlier, reuse | Plan caching, prepared statements, compiled code | The decision cost is spread over many runs | The decision is made without the information that mattered |
| Decide later, revise | Adaptive execution, dynamic sizing | Measurements instead of estimates | A barrier, and determinism |
| Do not decide, reuse the answer | Result caching, subplan memoization | The whole computation | Storage, 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.)