What Is a Query Plan?
A query plan is the sequence of operations the database optimizer selects to run a query, such as which tables to scan, which indexes to use, and how to order joins. The optimizer estimates the cost of alternatives and picks the cheapest. Tools like EXPLAIN reveal the chosen plan so you can see why a query is fast or slow.
Why it matters
Reading the query plan shows whether the engine used your indexes or fell back to a full table scan. It is the primary tool for diagnosing and fixing slow queries.
Related guides
What Is a Full Table Scan?A full table scan reads every row in a table to satisfy a query, which is slow on large tables and usually si…
What Is a Database Index?A database index is an auxiliary data structure that lets the engine find rows matching a query quickly, avoi…
What Is a Covering Index?A covering index contains every column a query needs, so the engine can answer it from the index alone withou…