pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Chirag Dave <cdave@ca.afilias.info>
To: Balkrishna Sharma <b_ki@hotmail.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: How to find if a SELECT is reading from buffer or disk ?
Date: Tue, 25 May 2010 14:22:36 -0400
Message-ID: <AANLkTimaCOhP9WDm8Dxuu2rBWLOvxksLjFPlFjEb_4uG@mail.gmail.com> (raw)
In-Reply-To: <BAY149-w19CB46743B9D1EC9D68760F0E80@phx.gbl>
References: <BAY149-w19CB46743B9D1EC9D68760F0E80@phx.gbl>

On Tue, May 25, 2010 at 1:48 PM, Balkrishna Sharma <b_ki@hotmail.com> wrote:

>  Hi,
>
> I am increasing the shared_buffer size in postgresql.conf and want to
> measure its effect on READ. In essence I want to know if the SELECT queries
> I am firing repeatedly is reading from the buffer or going directly to the
> disk.
>
> I am expecting the first SELECT to go to disk and the subsequent call of
> the same SELECT to read from buffer .
>
> Right now I am just looking at execution time of the SELECTs and trying to
> conclude. But there should be a direct way to see where the SELECT reads
> from.
>

You can also use pg_stat_database view. you can compute cache reads
percentage of the total number of reads (cache and physical) between the two
snapshots using  pg_stat_database.blks_hit  and pg_stat_database.blks_read.

Chirag Dave  416-673-4102
Database Administrator, Afilias Canada Corp.
cdave@ca.afilias.info





> How can I accomplish this ?
>
> Thanks
> Bala
>
> ------------------------------
> The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with
> Hotmail. Get busy.<http://www.windowslive.com/campaign/thenewbusy?tile=multicalendar&ocid=PID28326::T:WLMTAGL:ON:WL...;
>

view thread (6+ messages)  latest in thread

Message-ID: <AANLkTimaCOhP9WDm8Dxuu2rBWLOvxksLjFPlFjEb_4uG@mail.gmail.com>
Permalink:  ../AANLkTimaCOhP9WDm8Dxuu2rBWLOvxksLjFPlFjEb_4uG@mail.gmail.com/
Also on:    postgresql.org/message-id/AANLkTimaCOhP9WDm8Dxuu2rBWLOvxksLjFPlFjEb_4uG@mail.gmail.com

 · 

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: cdave@ca.afilias.info, b_ki@hotmail.com
  Subject: Re: How to find if a SELECT is reading from buffer or disk ?
  In-Reply-To: <AANLkTimaCOhP9WDm8Dxuu2rBWLOvxksLjFPlFjEb_4uG@mail.gmail.com>
  References: <BAY149-w19CB46743B9D1EC9D68760F0E80@phx.gbl> <AANLkTimaCOhP9WDm8Dxuu2rBWLOvxksLjFPlFjEb_4uG@mail.gmail.com>

* 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