Re: Needs Suggestion - Mailing list pgsql-general

From Magnus Hagander
Subject Re: Needs Suggestion
Date
Msg-id BANLkTi=cU6i3da=pEdTUKBQySdE9n6_drw@mail.gmail.com
Whole thread Raw
In response to Needs Suggestion  (SUBHAM ROY <subham.iem@gmail.com>)
Responses Re: Needs Suggestion
List pgsql-general
On Wed, Apr 27, 2011 at 16:35, SUBHAM ROY <subham.iem@gmail.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/

pgsql-general by date:

Previous
From: Andy Colson
Date:
Subject: Re: Index not being used for UPDATE?
Next
From: Tom Lane
Date:
Subject: Re: Partial Index [WHERE col IN ('A','B')] Planner Anomalies