What is a Covered Index?

Question :

What is a Covered Index?,

Answer :

I’ve just heard the term covered index in some database discussion – what does it mean?


A covering index is an index that contains all of, and possibly more, the columns you need for your query.

For instance, this:

SELECT *  FROM tablename  WHERE criteria  

will typically use indexes to speed up the resolution of which rows to retrieve using criteria, but then it will go to the full table to retrieve the rows.

However, if the index contained the columns column1, column2 and column3, then this sql:

SELECT column1, column2  FROM tablename  WHERE criteria  

and, provided that particular index could be used to speed up the resolution of which rows to retrieve, the index already contains the values of the columns you’re interested in, so it won’t have to go to the table to retrieve the rows, but can produce the results directly from the index.

Read More  Retaining HTTP POST data when a request is interrupted by a login page

This can also be used if you see that a typical query uses 1-2 columns to resolve which rows, and then typically adds another 1-2 columns, it could be beneficial to append those extra columns (if they’re the same all over) to the index, so that the query processor can get everything from the index itself.

Here’s an on the subject.

That’s the answer What is a Covered Index?, Hope this helps those looking for an answer. Then we suggest to do a search for the next question and find the answer only on our site.

Read More  Difference between NULL and null in PHP

Disclaimer :

The answers provided above are only to be used to guide the learning process. The questions above are open-ended questions, meaning that many answers are not fixed as above. I hope this article can be useful, Thank you