>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
>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