Let's say I have a table t1 with three columns A, B, C, where (A,B) comprise a unique key (with hundreds of thousands of rows). Since 90% of queries will be of the form SELECT C FROM t1 WHERE A=? and B =?, I suppose I want to have a covering index for A, B, and C.
How do I have a covering index that includes C and defines (A,B) as unique?
I'm thinking of having two indexes: one unique and one covering and using INDEXED BY to force the covering index for SELECTS.
Is this reasonable?
Aucun commentaire:
Enregistrer un commentaire