Re: SQL: Using index in select for performance - question?
Posted in 1996
Topics: Performance & Tuning, Connectivity: ESQL/C, 4GL & Embedded SQL, Clustering, Grid & MACH11
Shimon Gonen wrote: > > I am using informix online 7.1 > Have a table with 3 columns > 30,000 rows. > Have index on trip_level and date (see below) > > if I do a select ... where trip_level = 1 and > time >= "1996-08-21 09:34:07"; > or > select ... where time >= "1996-08-21 09:34:07" and > trip_level = 1; > it takes 17 seconds. > > if I do a select ... where time >= "1996-08-21 09:34:07"; > it takes 1 second. > > It looks like the server only uses the time index in the last case. > How can I get it to use the time index for all cases. > > Table info: > > Column name Type Nulls > > serial_number integer no > trip_level smallint no > time datetime year to second no > > > > Index name Owner Type Cluster Column > > 141_224 informix unique No serial_number > > ix148_5 informix dupls No trip_level > > ix148_6 informix dupls No time > > Thnaks.Did you try usin "SET EXPLAIN ON" in 4gl o isql ? It explains you which "strategy" is used by the kernel Bye :-)