What lookup structures forbid
What this article forbids
No structure gives all of these at once: constant-time point lookup, ordered range scan, cheap random update, and space near the entropy bound. The RUM triangle is the binding form of this. The order/no-order split is a second, harder constraint: order cannot be bought afterwards for less than the cost of a sort, and a hash can never serve a range predicate at any price.
More sharply: you cannot build a structure that is good for an access distribution you do not know. Every structure here encodes a bet, and the loss when the bet is wrong is not proportional. It is a cliff. Spilling, full scans, degenerate range joins and useless zone maps are all the same failure: the structure's assumption about the workload was violated and there was no graceful middle.
The escapes, and what each costs
| Escape | What it costs |
|---|---|
| Keep more than one structure (a primary index plus secondary indexes; a B-tree plus an inverted index) | Write amplification multiplies by the number of structures, and you get a consistency problem between them, which is how index maintenance becomes a transaction problem. In a distributed system you also choose between local secondary indexes (cheap writes, reads must ask every partition) and global ones (the exact opposite) |
| Rebuild instead of update (segments, SSTables, immutable files) | A collector, staleness, and read amplification against the set of unmerged pieces. It buys the compact static structures of perfect hashing almost free |
| Approximate | Correctness: a false-positive rate you must design around. This is Probabilistic structures |
| Restrict the workload (static key sets, monotonic keys, append-only) | Flexibility, and a brittle coupling to an assumption that will eventually be broken by a product decision nobody told you about |
| Adapt at runtime (database cracking, adaptive indexes, self-tuning layouts) | Unpredictability, and a performance profile that depends on query history, which makes incidents hard to reproduce |