Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is better and faster
Message
De
19/01/2005 04:32:45
 
 
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
OS:
Windows XP SP2
Divers
Thread ID:
00977833
Message ID:
00978445
Vues:
23
Hi Nadya,
>SET ANSI OFF
>select ... from ... where cl_name ="GREE" and cf_name = "MAR" and cM_Initial = ""
>or I can use
>lcName = padr("GREE",25,"_") + padr("MAR",20,"_")+padr("",1,"_")
>select ... from ... where cl_name + cf_name + cm_Initial LIKE lcName
First off: I believe if you set ansi off, the results should be different, so any comparison might be unfair just on the number of returned values for index expressions and the resulting data set - but I am a bit blurry at the moment from not enough sleep<g>.
select ... from ... where cl_name =="GREE" and cf_name == "MAR" and cM_Initial == ""
should be equal to
lcName = padr("GREE",25,"_") + padr("MAR",20,"_")+padr("",1,"_")
select ... from ... where cl_name + cf_name + cm_Initial == m.lcName
If your table is non-trivial, always include the MDot: it gets searched for every record.
For measuring "targeted" speed differences I'ld recommend putting the table and index onto another computer with a bottleneck connection: either use an old 10 MBit hub or serial connection to simulate a busy LAN - Probably then the second version will be faster if the table has many records. If speed is of utmost importance for this, also try out seek / scan while.

my 0.02 EUR

thomas
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform