Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Set filter
Message
From
26/06/2001 04:36:37
Walter Meester
HoogkarspelNetherlands
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00520806
Message ID:
00523438
Views:
9
Hi Moises, David,

>You should only use filtered tables and grids if you have very small number of records total on the order of a couple of hundred rows. Beyond that the performance of the grid will truly suffer. You will also have to deal with the vertical scroll thumb will not go all the way to the top or be sized relative to the number of rows. Parameterized views do not suffer these problems.

There is more to this problem. I have some project running which allow filtering in grids containing about a hundredthousand records and still performs well. It depends largely if the application is working on a single computer or trough a network. If running on a network performance becomes more of a problem than when running the database locally. Of course the bandwidth of the network is the bottleneck.

It also matters how selective your filter is. When it is higly selective (small resultset out of a large table) parameterized views are from a performance point of view much better than filters. OTOH, if selectivity is low (Large resultset out of a large table) parameterized views perform badly because it has to load all matching records at once where the filter is only evaluated for first record until the grid's height is filled.

Of course there are other differences also:
1. Parameterized views, should be requeried to display the actual contents, whereas with a filter a lock and unlock will do.
2. Parameterized views don't allow 'none, pessimistic row, pessimistic table buffering'
3. Parameterized views are (almost) always local, thus far faster than a remotely stored table.

As someone else is highlighting, SET KEY can be a solution too. Though it might not be optimimal in all cases, it can be a solution in a particular case.

Finally, SET FILTER and parameterized queries are by no means mutual exclusive. In my framework I allow users to set filters on the main table (in a grid) on any particular field. If this table is a p-view or an ordinary table, does not matter. Since I don't display hundred thousands of records in a grid, performance is quite well.

Walter,
Previous
Reply
Map
View

Click here to load this message in the networking platform