Re: Improvement of pg_stat_statement usage about buffer hit ratio

From: Haribabu kommi <haribabu(dot)kommi(at)huawei(dot)com>
To: KONDO Mitsumasa <kondo(dot)mitsumasa(at)lab(dot)ntt(dot)co(dot)jp>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Improvement of pg_stat_statement usage about buffer hit ratio
Date: 2013-11-18 11:16:36
Message-ID: 8977CB36860C5843884E0A18D8747B0372BED351@szxeml558-mbs.china.huawei.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 18 October 2013 13:35 KONDO Mitsumasa wrote:
> Hi,
>
> I submit improvement of pg_stat_statement usage patch in CF3.
>
> In pg_stat_statement, I think buffer hit ratio is very important value.
> However, it is difficult to calculate it, and it need complicated SQL.
> This patch makes it more simple usage and documentation.
>
> > -bench=# SELECT query, calls, total_time, rows, 100.0 *
> shared_blks_hit /
> > - nullif(shared_blks_hit + shared_blks_read, 0) AS
> hit_percent
> > +bench=# SELECT query, calls, total_time, rows,
> > +shared_blks_hit_percent
> > FROM pg_stat_statements ORDER BY total_time DESC LIMIT 5;
>
> It will be very simple:-)
>
> This patch conflicts pg_stat_statement_min_max_exectime patch which I
> submitted, and pg_stat_statement_min_max_exectime patch also adds new
> columns which are min_time and max_time. So I'd like to change it in
> this opportunity.

This patch adds another column "shared_blks_hit_percent" to pg_stat_statements view
Which is very beneficial to the user to know how much percentage of blks are hit.

All changes are fine and working as described. Marked as ready for committer.

Regards,
Hari babu

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2013-11-18 11:35:53 Re: Sequence Access Method WIP
Previous Message Michael Paquier 2013-11-18 10:52:29 Re: REINDEX CONCURRENTLY 2.0