Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Filtered query
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Filtered query
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01461413
Message ID:
01461413
Vues:
100
Hi,

I wanted to confirm that my thinking/approach in solving the following problem is valid.

Recently a customer called me complaining that a certain place in the application was taking too long (close to a minute). I tracked the issue to the code that was retrieving a query from a table. The SQL Select was as following:
select OneField from MyTable where PK_FLD = nValue into cursor MyCursor
go top in MyCursor      && This is where I think it takes too much time.
nValue = evaluate( MyCursor + ".OneField")
The slow down occurred - I believe - on the line GO TOP. The table MyTable has approaximately 80,000 records. There is an index tag on PK_FLD. So I believe that the query was filtered and therefore the GO TOP was going through all records in the table instead of just the resulting cursor. I intend to solve the issue by adding READWRITE to the SQL Select and therefore eliminating the possibility of filtered query.

But my question is, is the logic that possibly filtered query is causing this slow down?
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform