Break-even reuse count
A fixed cost derives a natural number of reuses: below it the investment is a loss, above it a gain.
- Fixed cost
- paid once: a sort, a compilation, a plan
- Saving per use
- what each later query, row or execution saves
Worked examples, recomputed
Every number the mechanisms quote for this relationship is recomputed from it, so none of them disagrees with it.
- 50 ms compile ÷ 20 ns saved per row → 2.5 million rows
- $65 to build, refresh and store ÷ $0.50 saved → 130 queries a month
- 2 TB kept a year: $552 against 4 × $60 = $240 to recompute
Where it appears
Each mechanism states it in its own names. The general symbol each name stands for is shown with it.
- Core Data Structures
How do we choose a data structure when the real cost is set by the hardware, not by Big-O?
sort_cost = · saving_per_query =
- Query Planning & Optimization
How does a system choose a plan for a question when the facts that decide the best plan are unknown until the plan has run?
C_compile = · Δc (saved per tuple) =
- Execution Engine Runtime
Once a query plan is chosen, why does the machine still sit idle, and what does each mechanism of a query runtime pay to buy that idle time back?
- Cost Mechanics
What is metered, and what is the smallest increment you are charged for?
B + R × changes + S × T = · savings per query =
- Cost Mechanics
What is metered, and what is the smallest increment you are charged for?