Optimizer statistics
A collection of information about data — row counts, value distributions, index sizes — used by the query optimizer to choose the best execution plan.
To choose between join strategies, the optimizer needs to know roughly how many rows match each filter. If "active=true" matches 5% of customers, that's good filtering; if it matches 95%, it's useless. Optimizer statistics track these distributions through histograms, samples, or other methods. The more accurate the statistics, the better choices the optimizer can make.
Statistics quickly become stale as data changes. Modern database systems update them periodically or entirely automatically. Stale statistics can lead to poor execution plans and slow queries — a classic database problem that emerged as soon as systems adopted cost-based optimization in the 1980s.