Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Filtered query
Message
De
21/04/2010 18:41:35
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01461413
Message ID:
01461414
Vues:
58
>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?

Is the GO TOP line even necessary? My understanding is the record pointer is located at TOP already once the result cursor is created, whether it's the result of a filter or not.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform