Re: Buffer usage in EXPLAIN and pg_stat_statements (review)

Takahiro Itagaki <itagaki.takahiro@oss.ntt.co.jp>

From: Itagaki Takahiro <itagaki.takahiro@oss.ntt.co.jp>
To: Euler Taveira de Oliveira <euler@timbira.com>
Cc: Pgsql Hackers <pgsql-hackers@postgresql.org>
Date: 2009-10-01T02:40:27Z
Lists: pgsql-hackers

Attachments

Euler Taveira de Oliveira <euler@timbira.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.

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center