问题
When we create an index on an attribute a tree is created for this attribute.
But what happens when we create an index with composite attributes? Two trees are created? Both are part of the same tree? What?
回答1:
It concats the attributes in the same order as you have mentioned. It for the same reason, if you have an composite index on columns a,b,c in the same order, the index will be useful only if the left columns are searched
WHERE a=4 ## uses index
WHERE a=4 and b=10 ## uses index
WHERE b=10 ## doesnot use index
来源:https://stackoverflow.com/questions/15349110/index-on-composite-attributes