mardi 6 janvier 2015

mysql multiple column index Cardinality order


How does Multiple-Column Indexes work in MySQL? How is it stored internally? consider a table with Multiple-Column Indexes on two columns (X,Y).


If X has High-cardinality than Y i.e., X is less duplicated than Y, what should be the order of multiple-column index X,Y or Y,X.


If it is X,Y there is going to be lesser number of rows with same X value. will this improve the performance because B-tree look up of X will be faster?





Aucun commentaire:

Enregistrer un commentaire