Consultor Eletrônico



Kbase P10604: FOR EACH with CAN-FIND() in the WHERE clause results in WHOLE-INDEX scan
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   4/1/2008
Status: Verified

FACT(s) (Environment):

Progress 9.x
All Supported Operating Systems

SYMPTOM(s):

FOR EACH with CAN-FIND() in the WHERE clause results in WHOLE-INDEX scan

WHOLE-INDEX in XREF

Sophisticated WHERE clause

CAN-FIND() function in WHERE clause. For example:
FOR EACH Customer NO-LOCK WHERE CAN-FIND( FIRST Order WHERE Order.custnum = Customer.Custnum):
DISPLAY CustNum NAME "Has Orders".
END.

CAUSE:

The use of CAN-FIND() in the WHERE clause of the FOR EACH prevents Progress from choosing the best index and results in a WHOLE-INDEX in XREF.

FIX:

This is an expected behavior.