Consultor Eletrônico



Kbase P114550: Why FIND FIRST statement is faster than FIND statement using an unique index?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/16/2008
Status: Unverified

GOAL:

Why FIND FIRST statement is faster than FIND statement using an unique index?

GOAL:

Why a FIND query without a NEXT,PREV, FIRST or LAST performs a different operation?

FIX:

A FIND query without a NEXT, PREV, FIRST or LAST performs an operation which is different from other FIND operations: it not only locates a record, but also ensures that it is the only record which satisfies the query. If more than one record is found, it returns an error. In order to achieve this, PROGRESS must find the first record, and then look for the next record and not find one. The second step can be very costly in some cases: for example, if the city field is not indexed, the query
find customer where (city = "Boston")
requires PROGRESS to scan the customer table until such a record is found, and then continue scanning the rest of the table to ensure that no other such record exists.
Whenever possible, the verification is done by the server, but if the server cannot execute the query, the client must verify the record's uniqueness in addition to performing the selection.