Re: informix does not use indexes?
Posted in 1998
ProzessDV wrote in message <19981022044515.03961.00004046@ng34.aol.com>...
>OWS 7.22 on SCO UNIX:
>
>The following SELECT-statement in dbaccess takes a long time until I get a
>result , although I have declared an index on col4 (the table "table" has
about
>400000 rows). But when I use "set explain on" and look at the output of
this
>statement, I see that there is no index used for the search, just
SEQUENTIAL
>SCAN. I also tried to set optimization high or low.
>
>select * from table where col4 = 2>
>Are there any options to set so that informix uses indexes, maybe?
Firstly, does the optimiser have current information about the index; ie
have you run an UPDATE STATISTCS recently?
Even if you have, the index may not be a good candidate for use. If there
are comparatively few distinct values for the index (male or female is a
classic example) it will be quicker to use a sequential scan than use the
index.
Neil Truby
aracnet Limited
Weybridge, UK