4

I came across this term reading my lecture notes; I can't find it on the internet.

My notes say the following:

Given a schema R(A,B) and a query of the form "A=a", or "B=b", or "(A=a AND B=b)". Two indices over "A" and "A,B" provide a cover-to-cover indexing of the schema.

If the schema contains N attributes, then the binomial (N, N/2) is the number of indices necessary to provide a cover-to-cover indexing.

Can someone shed some light on this topic? What is cover-to-cover indexing?

2

1 Answer 1

5

John M's link in the comments is perfect, but if you want a quick summary:

Covering indices allow the engine to pull all of the relevant data directly from the values in the indices themselves; in this way, the data pages never have to be loaded and parsed to fulfil the query and build the result set.

Example with index on (A,B):

SELECT B FROM table1 WHERE A=9;

For MySQL (let's say InnoDB), for example, on the B-TREE index at values of 9 for A, we can easily gather all of the values of B for the result set right from these same index nodes we're already reading, use of the pointers to the table data pages are not necessary since we have everything we need to fulfil the query already.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.