RE: select not using index
Posted in 1997
When you short your range in the WHERE clause, the optimizer chooses the index path, but in the first example, the optimizer is choosing the sequential scan path, Have you checked the SET EXPLAIN ON, I had a customer with the same problem, Try to set the configuration parameter OPTCOMPIND to 0, and see if it chooses the index path. PS: Did you turned off PDQ? Regards, ---------------------------------------------------------------- Mario Estrada | SISTECO, S.A. Departamento | Tel.(502) 3340214 de Soporte de Informix | Fax(502) 3344837 ---------------------------------------------------------------- --------------------------------->Reply = Separator<------------------------------------- ---------- From: Anon-user[SMTP:75052.1341@compuserve.com] Sent: Mi=E9rcoles 26 de Marzo de 1997 04:42 PM To: informix-list@rmy.emory.edu Subject: select not using index We have a select statement: "select count(*), avg(responseTime) from atable where seId =3D 1" Even though we have an index on seId it will not use it, even=20 after an update statistics and 80,000 rows. If we change the=20 where to 'where seid between 1 and 1' it uses the index. If we=20 just do a 'select count(*)' it uses the index. (seId is an=20 integer). I seem to remember a long while ago some similar problems with=20 Informix, but do not remember the details - does anyone else have=20 any idea why this would not use the index. We use Online 7.13 on=20 a DEC Alpha using OSF 3.2d. Any help appreciated. Paul R. (75052.1341@compuserve.com)