GaryMoore
20th June 2002, 11:20
I've been using query.extension in BaaN IV to limit the database reads that are taking place on alternate-key fields (i.e. secondary indices).
I've tried coding the following:
query.extension = "cseer962._index2 = {:clno}"
(this is a local table rather than a standard BaaN table).
The query takes some time to run, and after the DBA analyzed the select statement being called, it was using the main index (index1). This is the select statement produced:
SQL> SELECT /*+ FIRST_ROWS INDEX(a tcseer962321$idx1) */ a.t$adva,a.t$amex, etc
FROM baan.tcseer962321 a WHERE a.t$clno = :1 AND (a.t$vono >= :2) ORDER BY 116
Can anyone offer any suggestion as to why the index is not being used when I coded it, and perhaps offer a suggestion as to how I could force the script to use this index?
I've tried coding the following:
query.extension = "cseer962._index2 = {:clno}"
(this is a local table rather than a standard BaaN table).
The query takes some time to run, and after the DBA analyzed the select statement being called, it was using the main index (index1). This is the select statement produced:
SQL> SELECT /*+ FIRST_ROWS INDEX(a tcseer962321$idx1) */ a.t$adva,a.t$amex, etc
FROM baan.tcseer962321 a WHERE a.t$clno = :1 AND (a.t$vono >= :2) ORDER BY 116
Can anyone offer any suggestion as to why the index is not being used when I coded it, and perhaps offer a suggestion as to how I could force the script to use this index?