Usefulness of a multi-attribute index
-
31-10-2019 - |
Question
If an index has more than one attribute in it, is there any speed gained in a select
statement whose where
clause uses one of the attributes in the index?
For example, take a table T
with an index on attributes a
and b
. Is the index useful for the query:
select * from T where a='foo'
I ask because the book I'm reading has the following statement which I have trouble understanding:
If the key for the multiattribute index is really the concatenation of the attributes in some order, then we can even use this index to find all the tuples with a given value in the first of the attributes.
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange