Two Rejected Fixes Before the Real One
A query rewrite that shipped an 8.1x speedup still had one unbounded edge case left in it. Finding the actual fix took trying two more reasonable-sounding optimizations first, measuring both, and watching both make things worse.