Skip to content
About
Main content

A derived entry has a dependency set

Why does climbing the derivation ladder raise what an entry saves while lowering how often it can be used?

What makes data cacheable treated the cached object as opaque: a thing with a , a size and an invalidation rate w that was simply given. Now w is the thing being designed. Opening the object up shows the constraint that generates this whole article:

The organizing dimension is : how far the cached object sits from the base data. As you climb the ladder, three quantities move.

  • S, the saving per hit, rises: you skip more work.
  • w_eff = Σwᵢ, the invalidation rate, rises: more dependencies, each with its own write rate.
  • λ_eff, the share of traffic that can hit this specific entry, falls, because specificity rises. A cached file block serves every query that touches it. A cached query result serves only a byte-identical query from the same user in the same session context.

The third one is the one that actually kills things. Put these against the condition λ_eff / w_eff > P / S. Climbing the ladder improves the right-hand side (S rises) and attacks both terms on the left. Derived caching is squeezed from both ends of the same inequality. This is why the naive move, "cache the final answer, it saves the most", is usually the worst available choice.

Once you see the squeeze, the rest of the article organizes itself: every mechanism above the file-block level is an attempt to break one of the three couplings.

  • Semantic caching attacks the collapse of λ_eff.
  • Incremental view maintenance attacks the cost of w_eff rather than w_eff itself.
  • Metadata caching is the one place where all three happen to be favourable at once.
  • Negative caching is a degenerate case with P ≈ 0 and S maximal, so it passes the bar easily and fails for a completely different reason.

The ladder in one table

ObjectWhat must match for a hit (sets λ_eff)Dependency set (sets w_eff)PCoupling it breaksEscape when it fails
File / blockoffset and identitynone, if the file is ~0none needed
Resultquery text + plan + session environment + userevery input table, at any rowhighnone: worst case on all threeversion-fingerprinted key
Metadatatable identity onlyone commit to that table~0all three are favourablesplit mutable pointer from immutable body
a query the rewriter can match to itevery input, but repairable incrementallyvery highthe cost of w_effalgebra permitting delta maintenance
Semantic fragmentsubsumption, not equalityas a view, plus a decidability limithighthe collapse of λ_effsound-but-incomplete syntactic test
Negative entrythe exact absent keyexactly one key, and you know it~0P and S both maximally favourableseparate capacity partition

Read the table as a gradient with one anomaly. Everything gets worse with derivation distance except metadata, which sits high on the ladder and is nonetheless the best deal here. That anomaly is the most useful thing in this article, so we take it second.