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.