Skip to content
All concepts

Concept

Query plan

A query plan is the set of steps a database chooses to answer a query: which indexes to read, in what order to join tables and by which method. The planner picks it from estimates of how many rows each step will return, based on statistics about the data. When those estimates are far from the real counts, the plan can be thousands of times slower than a better one.

Watch the planner send every query down the nested loop while its row estimate is out of date. A live step from the lesson Reading query plans (Databases). Timings and counts are illustrative.

Where you'll see it