Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 89331632514 for ; Tue, 25 May 2010 14:59:26 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 66101-04 for ; Tue, 25 May 2010 17:59:19 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gw.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by mail.postgresql.org (Postfix) with ESMTP id 5F9C7633CED for ; Tue, 25 May 2010 14:59:19 -0300 (ADT) Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Tue, 25 May 2010 12:59:18 -0500 Message-Id: <4BFBC9A40200002500031A64@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Tue, 25 May 2010 12:59:16 -0500 From: "Kevin Grittner" To: "Balkrishna Sharma" , Subject: Re: How to find if a SELECT is reading from buffer or disk ? References: In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-4.21 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201005/235 X-Sequence-Number: 34708 Balkrishna Sharma 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