Improvement of pg_stat_statement usage about buffer hit ratio

From: KONDO Mitsumasa <kondo(dot)mitsumasa(at)lab(dot)ntt(dot)co(dot)jp>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Improvement of pg_stat_statement usage about buffer hit ratio
Date: 2013-10-18 08:05:22
Message-ID: 5260EBC2.9000808@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

Regards,
--
Mitsumasa KONDO
NTT Open Source Software Center

Attachment Content-Type Size
pg_stat_statements-blkhit.patch text/x-diff 11.5 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2013-10-18 08:05:38 Re: space reserved for WAL record does not match what was written: panic on windows
Previous Message KONDO Mitsumasa 2013-10-18 08:02:59 Add min and max execute statement time in pg_stat_statement