IT lexicon › Database › Execution plan

Execution plan Query Execution Plan

Database På svenska → Updated: 2026-11-11

The sequence of operations a query optimizer constructs to execute a SQL query.

An execution plan might contain table scans, index scans, sorts, hash joins, nested-loop joins, and grouping operations in some order. The optimizer uses cardinality estimates, index availability, and CPU cost models to choose the cheapest plan. The same SQL query can have dramatically different performance depending on the plan—a bad plan might take hours, a good one takes seconds. Choosing join order is especially critical: a three-table join has six possible orders, and the difference in cost can be millions of I/O operations.

Most databases expose the plan via EXPLAIN commands for debugging and performance tuning. Learning to read plans is essential for database performance work.

← Back to the lexicon