Re: Improvement of pg_stat_statement usage about buffer hit ratio - Mailing list pgsql-hackers

From Haribabu kommi
Subject Re: Improvement of pg_stat_statement usage about buffer hit ratio
Date
Msg-id 8977CB36860C5843884E0A18D8747B0372BED351@szxeml558-mbs.china.huawei.com
Whole thread Raw
In response to Improvement of pg_stat_statement usage about buffer hit ratio  (KONDO Mitsumasa <kondo.mitsumasa@lab.ntt.co.jp>)
Responses Re: Improvement of pg_stat_statement usage about buffer hit ratio  (KONDO Mitsumasa <kondo.mitsumasa@lab.ntt.co.jp>)
List 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




pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: REINDEX CONCURRENTLY 2.0
Next
From: KONDO Mitsumasa
Date:
Subject: Re: Improvement of pg_stat_statement usage about buffer hit ratio