Re: Indexing
Posted in 1994
In article <2t0qca$fgs@emory.mathcs.emory.edu>, rridley@sin-pss.DHL.COM (Richard Ridley) says: > >Duc writes: > >| Could someone tell me how Informix pick and choose which index to use >| if I have a table with 2 indexes as following: >| table t_a ( >| f_1 integer, >| f_2 integer, >| f_3 integer, >| ..... >| ) >| >| index i_1(f_1, f_2) >| index i_2(f_3) >| >| and the where clause is something like this: where f_1 = 10 and f_3 = 15. Note: I didn't have Duc's original question around to answer, but one way to "force" the optimizer onto a specific index is to use ORDER BY. If you want the optimizer to use index i_1, then append ORDER BY f_1, f_2 to the query. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ Jim Burks jburks@promus.com ~ ~ Database Administrator / Systems Engineer ~ ~ The Promus Companies, Inc. Memphis, TN USA ~ ~ http://stargate.promus.com/public/jbb.html ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~