patternMinor
What is "cover-to-cover indexing"?
Viewed 0 times
indexingcoverwhat
Problem
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
"
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?
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 acover-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?
Solution
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):
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.
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.
Code Snippets
SELECT B FROM table1 WHERE A=9;Context
StackExchange Database Administrators Q#91420, answer score: 5
Revisions (0)
No revisions yet.