🗄️ Database Design / Normalization
Intermediate
What is a covering index?
Answer
A covering index includes all columns referenced in a query (in WHERE, SELECT, ORDER BY, GROUP BY) so the database can satisfy the entire query from the index alone, without accessing the base table. This eliminates a "table heap fetch" for each row, significantly improving performance for read-heavy queries. Example: for SELECT name, salary FROM employees WHERE dept_id = 5, a covering index on (dept_id, name, salary) allows the query to be fully resolved from the index. Covering indexes are a powerful optimization tool but increase index size and write overhead, so use them strategically for identified slow queries.
Previous
What is query optimization and what is a query execution plan?
Next
What is database partitioning?
More Database Design / Normalization Questions
View all →- Intermediate What are database anomalies and how does normalization prevent them?
- Intermediate What is denormalization and when is it used?
- Intermediate What are isolation levels in database transactions?
- Intermediate What are dirty reads, non-repeatable reads, and phantom reads?
- Intermediate What is query optimization and what is a query execution plan?