Chapter 34. Tow–Millsap Law
My friend Dan Tow and I once had a dinner conversation that led to the following postulate:1
No human ever wants to see more than ten rows (Tow–Millsap law).
Our idea was that once you’re presented with more than ten rows to look at, you’d really rather see some kind of aggregation of the data instead (count, sum, average, a graph…). Or, in Nancy’s case, just the one vendor name she was looking for instead of 800 that she never wanted to see in the first place.
So, the next time you’re asked to improve the performance of a program that returns a bazillion rows, at least ask whether the user using your program really wants to see all bazillion of them. It’s easier, cheaper, and more effective to give a user less data—only what she really wants—than to make your program faster at returning stuff that people didn’t really want to begin with.
1 Dan Tow, a former colleague from my years at Oracle Corporation, is the author of SQL Tuning: Generating Optimal Execution Plans (O’Reilly, 2003).
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access