Skip site navigation (1) Skip section navigation (2)

Re: caching table/query

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Tsirkin Evgeny <tsurkin(at)mail(dot)jct(dot)ac(dot)il>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: caching table/query
Date: 2005-07-17 14:06:55
Message-ID: 20050717140655.GA9637@winnie.fuhr.org (view raw or flat)
Thread:
Lists: pgsql-admin
On Sun, Jul 17, 2005 at 02:00:28PM +0300, Tsirkin Evgeny wrote:
> 
> I have several pretty little tables (~300 - 400 records) which are 
> queried very frequently.
> I would like to make postrgres be aware of this and do a in memory cache 
> for it .

PostgreSQL maintains a buffer cache in shared memory; if you enable
statistics gathering then you can see how effective it is for the
tables in question:

http://www.postgresql.org/docs/8.0/static/monitoring-stats.html

If the tables are small and you're querying them frequently, and
if shared_buffers is adequately sized, then I'd expect most or all
queries to be satisfied from the buffer cache.  Those that aren't
might still be satisfied from the OS's cache.

Are you experiencing performance problems?  Presumably that's the
real problem you're trying to solve.

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/

In response to

Responses

pgsql-admin by date

Next:From: Tsirkin EvgenyDate: 2005-07-17 14:58:46
Subject: Re: caching table/query
Previous:From: Tsirkin EvgenyDate: 2005-07-17 11:00:28
Subject: caching table/query

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group