Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Set Filter
Message
From
19/05/2009 15:55:00
 
 
To
19/05/2009 15:35:37
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01400783
Message ID:
01400794
Views:
60
>Surely an old question :) ...
>
>I have a file of about 500,000 records - file is about 40Mg in size.
>Records belong to 1 of 5 possible groups identified by a 20 char string field.
>There are about an equal number of records per group i.e. +/-100,000 per group.
>I want to allow the user to see only one chosen group of records at a time in a scrollable grid which has 3 colums.
>
>What is the fastest way to accomplish this? SET FILTER seems sluggish but perhaps I am not using it in the right way.

After SETting the FILTER you probably have to move the record pointer for it to take effect. If you want to go to the top record in the filtered set, ISTR it's faster to issue LOCATE than GO TOP.

"seems sluggish" - compared to what? A SELECT with the same parameters to a local cursor? If they both seem slow it might be worth looking at the usual suspects - slow network connection, antivirus etc.

Beyond that, I'd agree with Borislav, I'd try to pull small cursors, only the size of what's displayed in the grid. I'm not sure a native VFP grid handles a recordsource of 100K rows well. You could capture page up/down events to get new cursors. Up/down one line at a time is trickier, you can experiment with returning cursors with results (for a 20-row grid) -19 to +40 rather than 1 to 20, that gives some scrolling room without having to re-fetch.

Maybe there's some techniques in AJAX or ASP.Net client-side pagination control.
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
Previous
Reply
Map
View

Click here to load this message in the networking platform