This is a web catalogue application, just for reference.
Until lately, we had been querying the database for all products and then caching that query. We then let the application server use that cached query to show 10 products per page using a standard next/previous page format. The application server would be the device which determined the start and end rows to show.
This ran fine for many years, but now the company is adding many more products online each month, causing the initial query to take longer and longer as they do that.
What I am looking for is a way to simply request the 10 required rows from SQL server each time, rather than have to cache a huge query at the onset.
i.e. Page 1 would need to call data rows 1-10, Page 2 would need to call rows 11-20, etc etc
I know I can get the very first 10 records by using TOP, but for the life of me I am coming to a brain freeze when trying to get any other set of 10 rows!
This is likely a very simple task, but it is eluding me at the moment.
Any and all help is appreciated.
Until lately, we had been querying the database for all products and then caching that query. We then let the application server use that cached query to show 10 products per page using a standard next/previous page format. The application server would be the device which determined the start and end rows to show.
This ran fine for many years, but now the company is adding many more products online each month, causing the initial query to take longer and longer as they do that.
What I am looking for is a way to simply request the 10 required rows from SQL server each time, rather than have to cache a huge query at the onset.
i.e. Page 1 would need to call data rows 1-10, Page 2 would need to call rows 11-20, etc etc
I know I can get the very first 10 records by using TOP, but for the life of me I am coming to a brain freeze when trying to get any other set of 10 rows!
This is likely a very simple task, but it is eluding me at the moment.
Any and all help is appreciated.