Note that there are some explanatory texts on larger screens.

plurals
  1. POBest approach to paging database data in ASP.Net (SQL Database VS Webserver)
    primarykey
    data
    text
    <p>I have already implemented two pretty fast ways of paging a large MS SQL Server database table which contains at least <code>1,000,000</code> records, but have failed to determine the pros and cons of either method, advise on either would be greatly appreciated:</p> <p>The first is to run the SQL query and return only the Primary Key values of the filtered records, specifying a TOP clause of maybe 100-1000. These can then be placed into a session variable on the web server and paged through accordingly by supplying a subset of Primary Key values back to the server.</p> <p>One positive to this is the filtering of the records only occurs once when the user initially performs the search and secondly it gives the ability to page through the entire record set one item at a time if needs be, such as in previews of upcoming records, etc. This method also provides some benefits with regards to further filtering already filtered records, as filterable options can be determined by supplying the list of Primary Key values back to the SQL Server - such as common attributes, title, directors, etc.</p> <p>The second option is to perform both the filtering and paging via SQL Server, supplying variables such as 'records per page' and 'page number', etc .</p> <p>The benefit to this is that there is no need to clog up the web server with user sessions that size wise will undoubtedly be at least 1000+ bytes each, which will only cause problems in the long run as the number of web site users increases. In contrast, the down sides are ultimately what I've listed as being the positives for the first option, such as the lack of the ability to determine filtering options for the whole records set having only a single page or subset of Primary Key values to work with on the web server.</p> <p>What are everyone's thoughts given the above, especially with regards to storing the Primary Key values for the results in a session variable, memory, alternate options, etc?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload