The system that is running Progress 9x is a super fast AIX box so it bothers me when I see random several second delays for tables that are assumed to be properly indexed. I recognize that I can change the FE in the example to use an explicit WHERE clause here ... I am however hoping that someone can confirm that the OF clause is in fact responsible for these types of delays? NOTE tbl_two (table of items) is huge ... I have found it extremely difficult to prove this issue because the AIX system has a large CACHE ... the moment I rerun any code, AIX must be getting its data from the CACHE which normally negates any code/db fetch delays ... basically the first instance of a delay can't be reproduced. It sure would be nice if I could force Progress to always fetch DATA from DISK just for testing.
FIND FIRST tbl_one USE-INDEX primary-index.
FOR EACH tbl_two OF tbl_one. /* is this code potentially
causing a seek of all
records in the db when there
is no matching tbl_two rec?
*/
DELETE tbl_two.
END.
tbl_one
FIELD ref-num AS INTEGER
FIELD ... header fields
INDEX primary-index AS PRIMARY
ref-num ASCENDING.
tbl_two
FIELD ref-num AS INTEGER
FIELD ... item fields
INDEX primary-index AS PRIMARY
ref-num ASCENDING.
FIND FIRST tbl_one USE-INDEX primary-index.
FOR EACH tbl_two OF tbl_one. /* is this code potentially
causing a seek of all
records in the db when there
is no matching tbl_two rec?
*/
DELETE tbl_two.
END.
tbl_one
FIELD ref-num AS INTEGER
FIELD ... header fields
INDEX primary-index AS PRIMARY
ref-num ASCENDING.
tbl_two
FIELD ref-num AS INTEGER
FIELD ... item fields
INDEX primary-index AS PRIMARY
ref-num ASCENDING.