Lets say I've a table T with columns C1, C2 ... C10.
C1, C2 and C3 are most frequently refered columns in multiple queries. The order in which these columns are refered can't be controlled.
To improve query performance do I need to create multiple indexes such as (C1, C2, C3), (C1, C3, C2), (C2, C1, C3), (C2, C3, C1) etc.?
With example of two similar queries...
select * from t1, t2 where t1.c1 = t2.c1 and t1.c2 = t2.c2 and t1.c3 = t3.c3 and
select * from t1, t2 where t1.c2 = t2.c2 and t1.c1 = t2.c1 and t1.c3 = t3.c3
Do I need two indexes (C1, C2, C3) and (C2, C1, C3) for improving performance of above two different queries or just any one combination is enough for both the queries?
I guess it is not required and assume DB2 will be smart enough to rearrange columns in the query to match any one of the index combination as long as C1, C2 and C3 all are used.
Can anyone confirm and point me some articles related to that.
DB2 version used is 9.5 in AIX