Server-side and client-side sorting and filtering

Last modified: November 19, 2024

In dbForge Transaction Log, data sorting and filtering can be performed on the client or server side.

If there are not many records in a table, they are all displayed in the results grid after retrieving data from a table or after executing a SELECT statement. If you want to sort these records or use a filter, the filtering and sorting procedures are performed on the client side, and all the available records are processed.

Suppose there are many records in a table. In that case, they are not displayed at once after executing a SELECT statement or retrieving data because such actions can cause downtime of the client machine or other problems associated with excessive amounts of data.

Another scenario where not all records appear in the grid occurs when the paginal mode is activated, and the total number of records surpasses the quantity visible on a single page. In these cases, only the records available on the client machine are processed if you perform client-side sorting or filtering. It means you will get a partial result of your sorting or filtering operation. That is why the tool switches to server-side sorting or filtering when not all records can be displayed in the grid.

When server-side sorting or filtering is performed, the application sends a modified version of the input query to the server. Although this operation utilizes server resources, the user gets a complete result of their sorting or filtering operation.

But once all the records are received (for example, after pressing CTRL+END or scrolling to the end), server-side sorting or filtering switches to the client side.

Issues that may occur during server-side sorting or filtering

Here are the cases when the application cannot modify the input query and send it to the server to perform server-side sorting or filtering:

  • There is an expression without an alias in the SELECT statement. It is a restriction of SQL Server—you cannot modify a query that contains a statement without an alias in a SELECT statement. And if there is no alias for a column, you cannot sort or filter data in other columns until all the data is fetched or an alias is given.

  • There is a query with an ORDER BY clause. In this case, server-side filtering cannot be performed, which is another SQL Server restriction.