Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 6CCBB6325C5 for ; Tue, 25 May 2010 15:22:44 -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 73031-06 for ; Tue, 25 May 2010 18:22:36 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qy0-f196.google.com (mail-qy0-f196.google.com [209.85.221.196]) by mail.postgresql.org (Postfix) with ESMTP id 4153F632CFD for ; Tue, 25 May 2010 15:22:37 -0300 (ADT) Received: by qyk34 with SMTP id 34so8071481qyk.10 for ; Tue, 25 May 2010 11:22:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:reply-to:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type; bh=Lnc/mRUk9RD83QKIguYo+IkQFdn5obb2RrRHhGExN+M=; b=sRNop1mRLdNmgDzd3cS85ReIibNcxzzL57MtuZqEQ708vqQriSQXOQGI3grVfs9OgW ceTH6BrUUENgJS9eB2TnkoCvNGq2oOi72EyOJlC2gUOggm2/sR4j6R9WeG1m7AizahvE Lf+N4pudpROW+5Fyzorh2aPmakL4Wt5r3xodI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:reply-to:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=oxsWbgUjWWLcJkYL/YsWUKb1k2OGORNA3j902/hpGrs2Lf0WFZNUYH/uGIue2SxriC nbknFipXRr5NT82Rsk4AOKoh3THyLfkLY2OmUHE2zChLoIEQAAScGplPGj87mq6TZYR2 1MjU9PKa2+pDxzdpgY950Xz55uiLj+0L/0WcI= MIME-Version: 1.0 Received: by 10.224.96.15 with SMTP id f15mr4200674qan.67.1274811756253; Tue, 25 May 2010 11:22:36 -0700 (PDT) Reply-To: chirag.dave@gmail.com Received: by 10.229.220.203 with HTTP; Tue, 25 May 2010 11:22:36 -0700 (PDT) In-Reply-To: References: Date: Tue, 25 May 2010 14:22:36 -0400 X-Google-Sender-Auth: cr9EfkKmJK8JPb3G2L__wUL5JGk Message-ID: Subject: Re: How to find if a SELECT is reading from buffer or disk ? From: Chirag Dave To: Balkrishna Sharma Cc: pgsql-admin@postgresql.org Content-Type: multipart/alternative; boundary=00c09f8998bde315d304876f3d01 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.899 tagged_above=-10 required=5 tests=BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201005/239 X-Sequence-Number: 34712 --00c09f8998bde315d304876f3d01 Content-Type: text/plain; charset=ISO-8859-1 On Tue, May 25, 2010 at 1:48 PM, Balkrishna Sharma 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. > --00c09f8998bde315d304876f3d01 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Tue, May 25, 2010 at 1:48 PM, Balkris= hna Sharma <b_ki@h= otmail.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 goi= ng directly to the disk.

I am expecting the first SELECT to go to disk and the s= ubsequent call of the same SELECT to read from buffer .

Right now I am just looking at execution time of the SELECTs and tryi= ng to conclude. But there should be a direct way to see where the SELECT re= ads from.

You can also use pg_stat_database view. you ca= n compute cache reads percentage of the total number of reads (cache and ph= ysical) between the two snapshots using=A0 pg_stat_database.blks_hit=A0 and= pg_stat_database.blks_read.

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




How can I accomplish this ?

Thanks
Bala


The N= ew Busy think 9 to 5 is a cute idea. Combine multiple calendars with Hotmai= l. Get busy.

--00c09f8998bde315d304876f3d01--