Re: Buffer usage in EXPLAIN and pg_stat_statements (review)

From: Itagaki Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
To: Euler Taveira de Oliveira <euler(at)timbira(dot)com>
Cc: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Buffer usage in EXPLAIN and pg_stat_statements (review)
Date: 2009-10-01 02:40:27
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Euler Taveira de Oliveira <euler(at)timbira(dot)com> wrote:

> > But there are some confusions in postgres; ReadBufferCount and
> > BufferHitCount are used for "get" and "hit", but "heap_blks_read"
> > and "heap_blks_hit" are used for "read" and "hit" in pg_statio_all_tables.
> I see. :(

I fixed the confusions of get, hit and read in your patch.
long num_hit = ReadBufferCount + ReadLocalBufferCount;
long num_read = num_hit - BufferHitCount - LocalBufferHitCount;
should be
long num_get = ReadBufferCount + ReadLocalBufferCount;
long num_hit = BufferHitCount + LocalBufferHitCount;
long num_read = num_get - num_hit;

ReadBufferCount means "number of buffer access" :(

Patch attached.

ITAGAKI Takahiro
NTT Open Source Software Center

Attachment Content-Type Size
buffer_usage_20091001.patch application/octet-stream 22.6 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Mielke 2009-10-01 03:09:02 Re: Use "samehost" by default in pg_hba.conf?
Previous Message Robert Haas 2009-10-01 02:39:01 Re: Use "samehost" by default in pg_hba.conf?