Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
COPY TO ARRAY against a cursor?
Message
De
07/08/2019 09:10:34
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
06/08/2019 21:37:02
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., Nouvelle Zélande
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01669872
Message ID:
01669942
Vues:
66
>>>So it is faster for 4-5 rows??? What about 10 or 15? My results with 11 rows:
>>>Using COPY TO ARRAY 10000 passes took 0.330.Records in result = 11
>>>Using SQL SELECT 10000 passes took 0.327.Records in result = 11
>>>Using SQL SELECT to cursor 10000 passes took 0.440.Records in result = 11
>
>Newly restarted VFPA running the code below: Note the table is closed between tests to try to minimize benefit of caching for tests 2 and 3,
>
>Using COPY TO ARRAY, 10000 passes took 0.073; records in result = 12
>Using SQL SELECT, 10000 passes took 0.528; records in result = 12
>Using SQL SELECT to cursor, 10000 passes took 0.463; records in result = 12
>

I can't confirm these results on VFP SP1. Exact same code, copy to array takes 139 ms, while others 240 and 219 ms on my system. Yesterday, I got the results with "set talk off", on data\Employee, but was on batteries, don't know if it was the reason. Today tried on fresh boot of windows. Such an inconsistency also made me think this test is not reliable.

Probably VFPA means what you call "VFP Advanced", which I don't have and don't use. That is interesting in VFPA, SQL-SELECT operations seem to be slower than xbase commands.

Anyway, in either case, I don't see the results worthy enough to choose one over another. They have pros and cons.

PS: For cursor test, you should include NOFILTER for a true cursor and remove "release aFrance..." which explicitly makes it lose more time for no reason. And you should include Local array declaration. That is what one normally want to do in real world app.
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform