On Wed, Apr 27, 2011 at 16:35, SUBHAM ROY <subham(dot)iem(at)gmail(dot)com> wrote:
> Can I calculate the Buffer Hit ratio of a particular query in postgres? That
> is how many times it finds the required page in its buffer cache,
> pg_buffercache or the
> linux buffer cache.
You can get the information from the pg cache using
EXPLAIN (ANALYZE, BUFFERS) <your query>
It won't get you the stats from the linux filesystem cache though. You
can perhaps use pgfincore for that in some way.
--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/