Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Paging in Sql Server

Status
Not open for further replies.

NaoTriste

Programmer
Dec 17, 2002
29
GB
I am trying to return the results of a query in Sql Server
(to an asp.net front end but this is irrelevant) in page sets depending on a requested Page No. & Page size to reduce the network traffic.
I have tried two different solutions, one using a set of nested queries using the TOP clause and the other solution using a temporary table to store the no. of records containing the page required and then using the temp table serial key to extract the ones pertinent to the page.
These are pretty similar to the solutions proposed by Microsoft but extensive testing has revealed that the query slows down considerably within certain areas.

For the nested queries solution it seems to slow down when you request a page in the middle (not the end as I expected) [/color ]

[COLOR=green ] For the Temp table solution, the query seems to slow down towards 7% area of the total no of pages. [/color ].

I've put the results in a spreadsheet to see if I could see a pattern but I can't make any sense of it at all.

[COLOR=red ] Has anyone experienced this kind of performance erosion and knows why and how can you fix it ??? [/color ]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top