Re: Cache Query..

Started by Shridhar Daithankarover 22 years ago3 messagesgeneral
Jump to latest
#1Shridhar Daithankar
shridhar_daithankar@persistent.co.in

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"

#2Alvaro Herrera
alvherre@dcc.uchile.cl
In reply to: Shridhar Daithankar (#1)

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)

#3jerome
jerome@gmanmi.tv
In reply to: Shridhar Daithankar (#1)

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

Show quoted text

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