a slow query selection.
Posted in 1999
Topics: Performance & Tuning, SQL Development & Query Writing, Connectivity: ESQL/C, 4GL & Embedded SQL
To all,
I am working on a selection by using ESQLC to popup some info
from a table for a number of selected accounts. Here is my select statement:
select acctno, detail_num from detail_table
where acctno in ("n1, n2, n3, n4, ....nn")
where:
n1-nn: my selected account number
Column name Type
detail_num char(10)
acctno char(10)
index1- unique - detail_num, acctno
index2- dupls - acctno
The query selection run very slow even when there are only
821,026 records in the table.
Could anyone point me out a better way in to get the same result with a
higher performance ??? My Informix is 7.3.
Thanks advance for your advice & suggestion.
Thai.
Thai Nguyen wrote:
>
> To all,
> I am working on a selection by using ESQLC to popup some info
> from a table for a number of selected accounts. Here is my select statement:
>
> select acctno, detail_num from detail_table
> where acctno in ("n1, n2, n3, n4, ....nn")>
> where:
> n1-nn: my selected account number
>
> Column name Type
> detail_num char(10)
> acctno char(10)
>
> index1- unique - detail_num, acctno
> index2- dupls - acctno
>
> The query selection run very slow even when there are only
> 821,026 records in the table.
>
> Could anyone point me out a better way in to get the same result with a
> higher performance ??? My Informix is 7.3.
>
> Thanks advance for your advice & suggestion.
>
> Thai.
Crete index:
"index1- unique - acctno, detail_num" instead of "index1- unique - detail_num,
acctno"
--
Jarosław Stanisz
jareks@galkom.com.pl
tel.852-43-25
Have you ever tried an UPDATE STATISTICS FOR TABLE detail_table?