Walter Meester
HoogkarspelNetherlands
General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Kevin,
>SELECT *;
>FROM Table;
>WHERE Field = MainTable.PKField;
>INTO ARRAY aTemp
>IF _TALLY > 0
> RETURN .F.
>ELSE
> RETURN .T.
>ENDIF
>The field used in the select will be an indexed field - so is optimized.
>If I use the SEEK - I would just
>
>IF SEEK(cValue)
> RETURN .T.
>ELSE
> RETURN .F.
>ENDIF
The seek is definitely faster, no doubt about this. In stead of the IF construction, you could just use:
RETURN SEEK(cValue)
The reason seek is faster, is that YOU tell VFP which index to use and in what way. With SQL - SELECT VFP has to process a lot of code how to retrieve the record, Rushmore is an important part of this. When using rushmore, VFP has to investigate which indexes to use.
Walter,
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only