Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What's faster - SELECT SQL or LOCATE?
Message
De
22/06/2000 13:05:23
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00383232
Message ID:
00383268
Vues:
26
Hey Doug,

I tested this on a table with over 464K records in a DBC with a PK defined. The SELECT could only find one record.

If the search/where expression matched an index key, then LOCATE and SELECT took from .01 (!) and .11 seconds. Each test made one or the other marginally faster so it's a crapshoot which would be faster in production. SEEK was near instantaneous as far as I could tell (<.01 seconds).

When I removed the index and did a search where there was no index, both commands were slower and this time SELECT seemed somewhat faster. In my three tests:


LOCATE times (in secs): 5.88 2.08 2.09
SELECT times (in secs): 2.31 1.87 1.70

This was tested on a PII 266MHz, VFP6.0 SP3, 64MB RAM.

>I expect the table to grow pretty large - over 1 million records. In general...what is faster - a LOCATE or SELECT SQL statement for locating a single record?
>
>Thanks,
>Doug
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform