pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Fuhr <mike@fuhr.org>
To: Tsirkin Evgeny <tsurkin@mail.jct.ac.il>
Cc: pgsql-admin@postgresql.org
Subject: Re: caching table/query
Date: Sun, 17 Jul 2005 08:06:55 -0600
Message-ID: <20050717140655.GA9637@winnie.fuhr.org> (raw)
In-Reply-To: <42DA3A4C.3080009@mail.jct.ac.il>
References: <42DA3A4C.3080009@mail.jct.ac.il>

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/



view thread (9+ messages)  latest in thread

Message-ID: <20050717140655.GA9637@winnie.fuhr.org>
Permalink:  ../20050717140655.GA9637@winnie.fuhr.org/
Also on:    postgresql.org/message-id/20050717140655.GA9637@winnie.fuhr.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: mike@fuhr.org, tsurkin@mail.jct.ac.il
  Subject: Re: caching table/query
  In-Reply-To: <20050717140655.GA9637@winnie.fuhr.org>
  References: <42DA3A4C.3080009@mail.jct.ac.il> <20050717140655.GA9637@winnie.fuhr.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox