Database indexing from 1K to 1B rows: how the right strategy changes as a table grows
An index plan that is perfect at a million rows becomes a liability at a billion. We walk one events table through four sizes, show where the planner changes its mind, and what we added, removed or replaced at each stage.