Answer the question
In order to leave comments, you need to log in
Composite index and selectivity of its columns?
The composite index b of type is compared by tuples, that is, the order of index definition matters - (a,b) and (b,a) are not equivalent. Let's say there are two columns in some abstract table: x - foreign key, y - datetime, respectively, x has lower selectivity than y
I know and understand that it is better to define b index for columns with high selectivity, that is, the order will be as follows - ( y,x).
I'm right?
Answer the question
In order to leave comments, you need to log in
Composite index b of type is compared by tuples, that is, the order of index definition matters
In the general case - yes, such an index will work faster and rebuild faster.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question