Re: Why Does Sorting Require Another Call To The Database?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Colin Young (x_at_nospam.com)
Date: 08/02/04


Date: Mon, 2 Aug 2004 16:54:57 -0400

The problem with persisting the data in memory is that you might get
hundreds or thousands of requests between when the user requests the
original data and when they request the sorted data. You might even update
the underlying data, thereby invalidating the cached data, but I'll ignore
that possibility.

Now if you aren't getting that sort of traffic, there's a really good chance
you aren't really taxing the capabilitied of your DB server. If you are
getting that sort of traffic, it's entirely likely that server-side caching
is going to very quickly fill up the web server's memory, or the cached data
will be flushed before the user requests the resorted data. What you really
want to do is cache the data that all the users are requesting all the time.

See if this article is a good starting point:
http://aspnet.4guysfromrolla.com/articles/100902-1.aspx

The quickest way would be if you could cache it at the user's end, but there
isn't a good cross-platform solution for that (at least not one I'm aware
of).

Colin

"Lisa" <lisa@starways.net> wrote in message
news:cc62d1fa.0408020658.4970aa1e@posting.google.com...
> I hope someone can help with this.
>
> Every example I've seen, and every example I've written, where I fill
> a datagrid from a recordset I get from the database, requires me to go
> back to the database and get the recordset again every time I sort by
> a column.
>
> Maybe I'm just not understanding the concept, but since I already have
> the data in the datatable, why shouldn't I be able to persist that on
> the server and just sort the data that I already have? Why is it
> necessary to go banging on the database every time I want to sort?
>
> Is it possible to sort without going back to the database? Is there a
> reason why it's a bad idea? It seems that it'd be the most user
> friendly (quickest) way to do things, no?
>
> Thanks,
> Lisa



Relevant Pages

  • Re: Typical work day
    ... >>> these requests? ... >> be honest I think if one was developed nobody would bother using it. ... But I admit probably less than 5% of our code has any sort of test ... shipped from an alternate location as well as products being shipped from ...
    (comp.programming)
  • Re: "R/R & S" where to dine while on road trip (long)
    ... Recommendations/Requests & Suggestions" as a future show title on some sort of cable/satellite TV channel! ... And/Or, any form of "Recommendations, Requests, and Suggestions" or "Requests, ... main routes most likely taken would be the direct interstate highways. ...
    (rec.food.cooking)
  • Re: "R/R & S" where to dine while on road trip (long)
    ... Recommendations/Requests & Suggestions" as a future show title on some sort of cable/satellite TV channel! ... And/Or, any form of "Recommendations, Requests, and Suggestions" or "Requests, ... scenic detours would not be out of the ...
    (rec.food.cooking)
  • Re: Missed It By That Much
    ... plus display screens of some sort. ... an incident of hardcopy output, though I expect there was at least one. ... requests hardcopy output. ... Capt. Gym Z. Quirk quirk @ swcp.com ...
    (rec.arts.sf.written)
  • Re: [PATCH linux-2.6-block:master 02/05] blk: update ioscheds to use generic dispatch queue
    ... >>iosched to dump all requests it has. ... > That was the case before and I agree it's better to sort everything. ... Currently all ioscheds dispatch requests in sorted order. ...
    (Linux-Kernel)