Consultor Eletrônico



Kbase P36144: Is there a difference between a FIND and a FIND FIRST when t
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   08/08/2003
Status: Unverified

GOAL:

Is there a difference between a FIND and a FIND FIRST when the index is unique?

FIX:

Yes, there is a difference. Even if a unique index is used (either by our normal index selection process or by a USE-INDEX phrase) a FIND statement without the FIRST option goes through some extra code to determine whether multiple records match the WHERE clause criteria. In this scenario the extra time taken for the ambiguousness test may take a few milliseconds, however, if the FIND statement is inside a block that is executed many thousand (or hundreds of thousands of times) the cumulative effect of those 'few milliseconds' will quickly add up and may well be the root cause of what is perceived to be a poorly performing query.

If you do not explicitly need to check for ambiguity (i.e. the AMBIGUOUS function) then use the FIND FIRST statement rather than the plain FIND statement.