Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select Statement appears to be filtering
Message
From
01/07/2006 13:58:18
Mike Yearwood
Toronto, Ontario, Canada
 
 
To
30/06/2006 16:28:58
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01132775
Message ID:
01133272
Views:
23
>>>>>>All,
>>>>>>
>>>>>>I am querying a VFP table that has about 1.5 million records. The table is indexed on a date field called aaddb. My query shows that it returned 13,533 records on the status bar. Then the status bar message changes and it states: Tcursor(c:\arrestees.dbf) Record: 24/1427204.
>>>>>>Only the records I have selected show in the browse window. However if I do a ?reccount() it shows that there are 1427204 records in my cursor. If I select all of the records from the cursor into a new cursor I get all 1427204 records from the original table.
>>>>>>
>>>>>>This is my query.
>>>>>>
>>>>>>SELECT * FROM arrestees where BETWEEN(aaddb, CTOD('12/30/1939'), CTOD('12/29/1941')) into cursor tCursor
>>>>>>
>>>>>>
>>>>>>How can I get just the records I am trying to select? This is a new one on me.
>>>>>
>>>>>That's a long-known issue. If the query is 100% rushmore optimizable, vfp may just do a SET FILTER. I have been adding NOFILTER to every query for many years now.
>>>>
>>>>Personally I add READWRITE in stead of NOFILTER. The net result is the same plus the new cursor is read/write.
>>>
>>>Personally I put them both in. Aiming to leave no doubt with the reader.
>>
>>That's a good point, but if a cursor is not going to be updated, I still put nofilter, just don't include readwrite. Readwrite must do more than just NOFILTER?
>
>AFAIK READWRITE was introduced in a later version than NOFILTER, and READWRITE makes NOFILTER redundant. READWRITE simply sets a flag on the cursor, so the overhead of using READWRITE compared to NOFILTER is zero.

However, I'm of the opinion that an ounce of prevention is really worth pounds of cure. If I'm pulling a cursor that is not going to be updated I will not add rewrite. select * from table nofilter gives me a readonly cursor. select * from table nofilter readwrite gives me a non-readonly cursor.

If I should happen to issue a replace command against the readonly cursor, I've saved my sanity because the data could not affected.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform