Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is more efficient of the two
Message
De
12/07/2006 07:52:48
Dorin Vasilescu
ALL Trans Romania
Arad, Roumanie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Database:
MS SQL Server
Divers
Thread ID:
01135592
Message ID:
01135632
Vues:
13
>Hi Borislav
>
>>If you SCAN through relatively small ammount of records maybe the difference in speed will not be visible, if you have many ecords in SCAN I expect this to be faster because your query is compiled at SQL Server side and SQL Query optimizer is already done its job and after you issue SQLEXEC() its just follow the execution plan. But as I said this is only my expectations.
>
>Thanks a lot for the idea. I will definately give it a try.

You can do another way
prepare an indexed result cursor with CREATE CURSOR
SCAN spt cursor
    Build a select clause with IN ( primary keys ) based on source spt cursor
    if n records
       SQLEXEC() 
       insert into result from spt cursor
       reset SQL Command
ENDSCAN

then 
SCAN
    SEEK result cursor
    do stuff
ENDSCAN
If you already know record range, I think that it will be faster to get both cursors first
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform