Re: Why Does Sorting Require Another Call To The Database?
From: Colin Young (x_at_nospam.com)
Date: 08/02/04
- Next message: Eric: "How can I select items in a datagrid to populate a second datagrid."
- Previous message: Carlos: "How to print Data grid?"
- In reply to: Lisa: "Why Does Sorting Require Another Call To The Database?"
- Messages sorted by: [ date ] [ thread ]
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
- Next message: Eric: "How can I select items in a datagrid to populate a second datagrid."
- Previous message: Carlos: "How to print Data grid?"
- In reply to: Lisa: "Why Does Sorting Require Another Call To The Database?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|