Re: informix does not use indexes?
Posted in 1998
ProzessDV wrote:
>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?
>
Did you run "update statistics" for ths table ?
If you did - what is col4 type ? If it is INT(SMALLINT) -
just try to (well I know it is not very much sense in this, and I read
about this method in Informix Unlieshed, and sometimes this works):
1. Double the condition
col4 = 2
AND col4 = 2
2. Set a new query:
" col4 = 2
AND col4 BETWEEN 2 AND 2 "
or
" col4 = 2
AND col4 IN (2) "
Hope it helps,
Octav
--
Octav Chiriac Phone: (373) 2 21 20 96
NetInfo S.R.L. Fax: (373) 2 21 36 59
Chisinau (373) 2 24 00 83
Moldova, Republic of mailto:com@netinfo-moldova.com