Thread: Cache Query..

Cache Query..

From
jerome
Date:
is postgres capable of throwing cached results... or the right question is.. does postgres
cache query results?

if yes.. to both... can someone point me to a documentation that tacle this....

TIA

Re: Cache Query..

From
"Shridhar Daithankar"
Date:
On 18 Jul 2003 at 2:52, jerome wrote:

> is postgres capable of throwing cached results... or the right question is.. does postgres
> cache query results?
>
> if yes.. to both... can someone point me to a documentation that tacle this....

Postgresql does not cache results. It caches data. It calculates results as and
when required.

And for caching data, it largely relies upon OS.

HTH

Bye
 Shridhar

--
Peace, n.:    In international affairs, a period of cheating between two    periods
of fighting.        -- Ambrose Bierce, "The Devil's Dictionary"


Re: Cache Query..

From
jerome
Date:
im creating a page that will be queried from time to time... to output the
results in a fast manner the easiest way is to return cached results... i was
thinking if postgres can do this... otherwise hope the webserver (aol) can
help me..


TIA

On Thursday 17 July 2003 19:01, you wrote:
> On 18 Jul 2003 at 2:52, jerome wrote:
> > is postgres capable of throwing cached results... or the right question
> > is.. does postgres cache query results?
> >
> > if yes.. to both... can someone point me to a documentation that tacle
> > this....
>
> Postgresql does not cache results. It caches data. It calculates results as
> and when required.
>
> And for caching data, it largely relies upon OS.
>
> HTH
>
> Bye
>  Shridhar


Re: Cache Query..

From
Alvaro Herrera
Date:
On Fri, Jul 18, 2003 at 03:40:25AM +0800, jerome wrote:
> im creating a page that will be queried from time to time... to output the
> results in a fast manner the easiest way is to return cached results... i was
> thinking if postgres can do this... otherwise hope the webserver (aol) can
> help me..

Well, if you don't need it to be 100% accurate, you can create a table
with the results that is generated from time to time.  Better yet,
TRUNCATE the table and fill with the new data in a single transaction;
queries still running will be able to see the old data so you won't have
'downtime'.  Maybe you could even truncate the results table in a
trigger as soon as the original data is modified.  (The best part of
this approach is that you won't need to vacuum the table.)

Not sure if rollbackable truncate is in 7.3 though...  it's in 7.4 for
sure.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
Voy a acabar con todos los humanos / con los humanos yo acabaré
voy a acabar con todos / con todos los humanos acabaré (Bender)