Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Rushmore work differently in VFP9?
Message
De
10/03/2005 10:07:41
 
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 9
Database:
Visual FoxPro
Divers
Thread ID:
00994380
Message ID:
00994435
Vues:
24
That's weird, since PADR(ALLTRIM(field),5) and PADR(field,5) gives the same result.

>Brian Based on Tore answer this code shows FULL optimisation in Both cases (VFP9):
>
>SET ANSI OFF
>SET EXACT ON
>CLEAR
>* Turn rushmore reporting on
>SYS(3054,2)
>* Create a test cursor
>CREATE CURSOR test (field C(10))
>INDEX on field TAG field
>INDEX on PADR(ALLTRIM(field),5) TAG field_t
>* Put some data in the cursor
>FOR i = 1 TO 10000
> INSERT INTO test VALUES (SYS(2015))
>ENDFOR
>
>* Determine the last value
>cValue = LEFT(test.field,LEN(ALLTRIM(test.field))-1)
>* Try the untrimmed index
>?"This one works"
>?"---------------------------------"
>SELECT * FROM test WHERE field = cValue INTO CURSOR index
>* Try the trimmed index
>?
>?"This one does not work"
>?"---------------------------------"
>SELECT * FROM test WHERE PADR(ALLTRIM(field),5) = cValue INTO CURSOR noindex
>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform