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

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "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-25 17:59:16
Message-ID: 4BFBC9A40200002500031A64@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Balkrishna Sharma <b_ki(at)hotmail(dot)com> wrote:

> 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.

There's a third option -- PostgreSQL reads and writes will normally
go through the OS cache.

> 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.
> How can I accomplish this ?

You didn't mention your OS. There's usually a way to monitor disk
I/O built in to the OS. I usually start with:

vmstat 1

-Kevin

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Balkrishna Sharma 2010-05-25 18:01:22 Re: How to find if a SELECT is reading from buffer or disk ?
Previous Message Balkrishna Sharma 2010-05-25 17:48:34 How to find if a SELECT is reading from buffer or disk ?