Walter Meester
HoogkarspelPays-Bas
Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
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,
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement