Re: How To Return A "Range Of Rows"??



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
.



Relevant Pages

  • Re: SQLServer Connection Problems...
    ... IPNetworkAddressTranslator is disabled on the web server. ... Most good judgment comes from experience. ... SQL Server is starting at priority class 'normal'. ...
    (microsoft.public.sqlserver.connect)
  • Re: sa loginname being hacked
    ... the password (thus possibly compromising the database server). ... work (and it's not just in the SQL Server world, ... a VPN client built into Windows, ... a web server which in turn updates the same SQL Server which in turn is ...
    (microsoft.public.sqlserver.security)
  • Re: SQLServer Connection Problems...
    ... Most good judgment comes from experience. ... Only take this step if your server is protected inside a good firewall... ... I can ping the SBS server from the Web Server on a local ip address ... SQL Server is starting at priority class 'normal'. ...
    (microsoft.public.sqlserver.connect)
  • Re: SQLServer Connection Problems...
    ... Only take this step if your server is protected inside a good firewall... ... Most good judgment comes from experience. ... Windows Firewall is disabled on the web server and is not installed on the ... SQL Server is starting at priority class 'normal'. ...
    (microsoft.public.sqlserver.connect)
  • Re: SQLServer Connection Problems...
    ... How do I create a "trusted connection" across domain boundries? ... Only take this step if your server is protected inside a good firewall... ... I can ping the SBS server from the Web Server on a local ip address ... SQL Server is starting at priority class 'normal'. ...
    (microsoft.public.sqlserver.connect)