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

Re: How to find if a SELECT is reading from buffer or disk ?

From: Chirag Dave <cdave(at)ca(dot)afilias(dot)info>
To: Cédric Villemain <cedric(dot)villemain(dot)debian(at)gmail(dot)com>
Cc: Balkrishna Sharma <b_ki(at)hotmail(dot)com>, pgsql-admin(at)postgresql(dot)org
Subject: Re: How to find if a SELECT is reading from buffer or disk ?
Date: 2010-05-26 14:16:47
Message-ID: AANLkTikmrCLCxpJp_pQcD-biISUsAkdLbQV192ZNCVs_@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-admin
On Wed, May 26, 2010 at 5:25 AM, Cédric Villemain <
cedric(dot)villemain(dot)debian(at)gmail(dot)com> wrote:

> 2010/5/25 Chirag Dave <cdave(at)ca(dot)afilias(dot)info>:
> >
> >
> > On Tue, May 25, 2010 at 1:48 PM, Balkrishna Sharma <b_ki(at)hotmail(dot)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.
>
> views does not reflect this exact behavior : hit and read are relative
> to hit shared buffers and request a block (from OS page cache or from
> disk).
>
>
Correct, thats where pgFincore will be usefull.

>
> >
> > Chirag Dave  416-673-4102
> > Database Administrator, Afilias Canada Corp.
> > cdave(at)ca(dot)afilias(dot)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.
> >
>
>
>
> --
> Cédric Villemain               2ndQuadrant
> http://2ndQuadrant.fr/     PostgreSQL : Expertise, Formation et Support
>

In response to

pgsql-admin by date

Next:From: Kevin GrittnerDate: 2010-05-26 15:40:59
Subject: Re: transaction_timestamp()
Previous:From: Ravi KatkarDate: 2010-05-26 10:35:11
Subject: Transaction with in function

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