Re: PowerBuilder 6 and Informix SE Query Problem
Posted in 1998
Try adding column e to you selection, SELECT a,b,c,d,e FROM table1 WHERE e =
"X"; It may do the trick.
Rajendra Singh wrote in message <35f023c4.20527426@n3.idirect.com>...
>I am running PowerBuilder 6 under Windows NT using the native Informix
drivers
>(to connect to my database (SE) running under HP-UX 9.07).
>
>I have a simple SELECT statement as follows:
>SELECT a,b,c,d FROM table1 WHERE e = "X";>
>When I run it in a PB application it takes a very long time to execute the
>statement even though there's an unique index on "e". When I run it on the
>server (using dbaccess), it returns almost instantly.
>
>I used "SET EXPLAIN" and found that when the PB application executes it,
>Informix is using a SEQUENTIAL SCAN instead of the index. Why is it doing
this?
>
>I tried setting OPTIMIZATION to low, but that didn't help. I tried
dropping and
>rebuilding the index, that didn't work either. I tried modifying the SQL
as
>follows:
>SELECT a,b,c,d FROM table1 WHERE e = "X" AND e = "X" AND e = "X";>(a suggestion from the Informix FAQ)
>... but this didn't help.
>
>How can I force Informix to use the index that already exists on column
"e"?
>Why is it ignoring the index?
>
>Any help would be appreciated. Thanks!
>--
>Mr. Rajendra Singh, B. Sc. (rajsingh@hotmail.com)
>"What is understood need not be discussed." - Loren Adams