Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Locate in large table
Message
De
15/04/2009 09:26:39
Mike Yearwood
Toronto, Ontario, Canada
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01394873
Message ID:
01394945
Vues:
73
This message has been marked as a message which has helped to the initial question of the thread.
>I have a very large table over 300,000 records
>
>I am using locate for command
>I can not use seek because I have conditions seek does not fulfill
>
>The first time a use the command locate,it is very slow
>
>The second time and then, locate is very fast
>
>The command is in a button of a form and table in date environment
>If I close the form, the first time I use locate it is slow again
>
>Is there any explanation for it ?

Caching. I open all tables at application startup. This benefits all subsequent table openings, even in private data session forms and sql queries.
A1=0
FOR X = 1 TO 1000
	USE \\SERVER\MYUEDATA\DATA\UEMEMBERS
	A=SECONDS()
	LOCATE FOR UPPER(SURNAME)="YEARWOOD"
	A1=M.A1+SECONDS()-M.A
ENDFOR X
?"CACHING",M.A1/1000

USE \\SERVER\MYUEDATA\DATA\UEMEMBERS
A1=0
FOR X = 1 TO 1000
	A=SECONDS()
	LOCATE FOR UPPER(SURNAME)="YEARWOOD"
	A1=M.A1+SECONDS()-M.A
ENDFOR X
?"NO CACHING",M.A1/1000
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform