Re: How To Return A "Range Of Rows"??
- From: Erland Sommarskog <esquel@xxxxxxxxxxxxx>
- Date: Fri, 13 Apr 2007 07:06:20 +0000 (UTC)
pbd22 (dushkin@xxxxxxxxx) writes:
I will go through this in detail after I get home. But, for now,
I am wondering if it is more cost-effective to do the paging logic
on the client or the server? I have already written all my paging
logic in javascript (basically, what that link provides, but in
javascript). Do I save on performance by moving the paging away from the
server or do you think it matters?
Disclaimer: I have no personal experience of writing web apps, so take this
as a grain of salt.
If you can be sure that the search can never return more than, say, 1000
rows (and this can be acieved by using TOP), reading all rows in one go,
and then page from the web server is likely to be better, since else
there would be an access to the database each time the user presses next.
But if the search could hit tens of thousands of rows, you need to have
some sort of batching mechanism, because if 100 users do that at the same
time, your web server will choke.
And you should not send all rows at once to the browser, unless the user
requests to see all rows. If the browser is on a slow connection, that
can be painful.
Finally: don't forget to give the user the option to see at least 100 items
at once. I hate sites where I only get a spoonful at a time.
--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.
- References:
- How To Return A "Range Of Rows"??
- From: pbd22
- How To Return A "Range Of Rows"??
- Prev by Date: Re: How To Return A "Range Of Rows"??
- Next by Date: execution plan for single stored procedure from profiler
- Previous by thread: Re: How To Return A "Range Of Rows"??
- Next by thread: ssis - Export to a file and Rename file
- Index(es):
Relevant Pages
|