Howdy all.
Doing some testing on a query that is part of a form to purge old records...
Seems the sql query below takes approx 20 mins to delete 473 records. In the
test form, I hardcoded the table name and association number (~strAssn'). I
also used a tcursor pointed at the table (UnitMsgs) and switched to the
secondary index of UnitNumFK thinking this might help... Checking via
TaskManager, the cpu is pegged at 99%.
DELETE FROM ~tblName
WHERE UnitNumFK IN (SELECT U.UnitNumPK
FROM
:HaiData:UnitMast U
WHERE
U.AssnNumFK = '~strAssn')
The Pdox qbe, on the other hand, deleted the 473 records in approx 15 secs.
Query
~strTblName | UnitNumFK |
Delete | _t1 |
:HAIData:UNITMAST | UnitNumPK | AssnNumFK |
EndQuery
I stayed with the QBE while all other queries were SQL. Could the problem be
related to the UnitMsgs table having a 3 part index (UnitNumFK (A6), MsgDate
(Date), MsgNum (autoincrement)?
Appreciate your comments/suggestions. As this form may later get included
into the SQL Svr conversion project, it'll be a mute point but currently its
got me puzzled...
Thanks,
Rey