Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cast() is evaluated for every record
Message
De
09/09/2004 10:01:41
 
 
À
09/09/2004 05:12:09
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro Beta
Divers
Thread ID:
00940524
Message ID:
00940616
Vues:
21
This is a good trick!

>On VFP the new CAST() function it will more become one of the functions used in SQL SELECT.
>
>Sin that the Engine does not recognize the specificity of this function and that the reexecute the CAST for every record, degrading the performances.
>
>A simple example, CAST a C(1) to a C(2):
>
>*********
>
>CLEAR
>SET TALK OFF
>
>CREATE CURSOR myCursor ( f1 C(1))
>
>FOR K=1 TO 100000
>INSERT INTO myCursor VALUES ('a')
>NEXT
>
>FOR K=1 TO 10000000
>NEXT
>
>T1=SECONDS()
>
>SELECT CAST(F1 AS C(2) NULL) F2 INTO CURSOR R1 FROM myCursor
>
>? 'TIME :',SECONDS()-T1
>LIST STRUCTURE
>
>T1=SECONDS()
>
>SELECT CAST(F1 AS C(2) NULL) F2 INTO CURSOR R2 FROM myCursor WHERE .F.;
>UNION ALL ;
>SELECT F1 FROM myCursor
>
>? 'TIME :',SECONDS()-T1
>LIST STRUCTURE
>
>
>The second it is twice more fast.
>
>Fabio
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform