Many people here ask about how to do either client or server filtering. What about both? And are there any best practices for balancing this?
Say you have a database with a million transactions from which you want to select only items from this year, an dyou know there are about 100 thousand of these. With a good database query this may return results quickly but there is overhead for going to the server, and then the resulting data needs to be paged.
For subsequent filtering when the user changes the filter in the grid, we have some options:
1) Go back to the server and perform another query from scratch using the user-defined refinement.
2) Go back to the server, and just refine the already selected subset of data stored in state "somewhere" (maybe a LINQ query on a collection stored in cache, rather than a SQL query to a relational database).
3) Filter the current subset on the client.
The ultimate question is, how do we know if the user wants to filter the subset of data, or if they want to filter on all data? For the above example, if we have a grid that displays countries and the filter is set to EqualTo USA, is that all USA transactions regardless of date, or all transactions for this year in the USA?
The user needs a button or other mechanism that clarifies their intent. For this we have seen examples where a text box is used for the user to enter a pre-filter, and the grid always operates on the subset of data provided there. In my opinion this is redundant and inadequate compared with the more sophisticated filter mechanism already provided in the grid.
How are people dealing with this? When a user changes their filter, which of the three above operations are you performing, and how do you allow the user to go back to a full query or refine their selection?
Thanks!
Say you have a database with a million transactions from which you want to select only items from this year, an dyou know there are about 100 thousand of these. With a good database query this may return results quickly but there is overhead for going to the server, and then the resulting data needs to be paged.
For subsequent filtering when the user changes the filter in the grid, we have some options:
1) Go back to the server and perform another query from scratch using the user-defined refinement.
2) Go back to the server, and just refine the already selected subset of data stored in state "somewhere" (maybe a LINQ query on a collection stored in cache, rather than a SQL query to a relational database).
3) Filter the current subset on the client.
The ultimate question is, how do we know if the user wants to filter the subset of data, or if they want to filter on all data? For the above example, if we have a grid that displays countries and the filter is set to EqualTo USA, is that all USA transactions regardless of date, or all transactions for this year in the USA?
The user needs a button or other mechanism that clarifies their intent. For this we have seen examples where a text box is used for the user to enter a pre-filter, and the grid always operates on the subset of data provided there. In my opinion this is redundant and inadequate compared with the more sophisticated filter mechanism already provided in the grid.
How are people dealing with this? When a user changes their filter, which of the three above operations are you performing, and how do you allow the user to go back to a full query or refine their selection?
Thanks!