Re: New function pg_stat_statements_reset_query() to reset statisticsof a specific query

Поиск
Список
Период
Сортировка
От Amit Kapila
Тема Re: New function pg_stat_statements_reset_query() to reset statisticsof a specific query
Дата
Msg-id CAA4eK1K8ggRx0jDYoV_cGMGimcZWLXQep74qMmEfR=LCpEUAqg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: New function pg_stat_statements_reset_query() to reset statisticsof a specific query  (Haribabu Kommi <kommi.haribabu@gmail.com>)
Ответы Re: New function pg_stat_statements_reset_query() to reset statisticsof a specific query  (Haribabu Kommi <kommi.haribabu@gmail.com>)
Список pgsql-hackers
On Tue, Jan 8, 2019 at 6:00 AM Haribabu Kommi <kommi.haribabu@gmail.com> wrote:
>
> On Tue, Dec 18, 2018 at 3:53 PM Amit Kapila <amit.kapila16@gmail.com> wrote:
>>
>> Can you add a few examples in the documentation?  See if it is
>> possible to extend the existing documentation section (F.29.4),
>> otherwise, add a new section.
>
>
> Apologies for the delay.
>

No problem.

> Attached the updated patch with addition of few examples usage
> of pg_stat_statements_reset() function with new parameters to the
> existing sample output.
>

Few minor comments:
1.
bench=# SELECT query, calls, total_time, rows, 100.0 * shared_blks_hit /
               nullif(shared_blks_hit + shared_blks_read, 0) AS hit_percent
          FROM pg_stat_statements ORDER BY total_time DESC LIMIT 5;

-[ RECORD 5 ]--------------------------------------------------------------------
query       | vacuum analyze pgbench_accounts
calls       | 1
total_time  | 136.448116
rows        | 0
hit_percent | 99.9201915403032721

There is nothing between the first and second time you ran this query,
so where did this vacuum analyze .. record came?

2.
bench=# SELECT pg_stat_statements_reset(0,0,s.queryid) FROM
pg_stat_statements AS s
bench-# WHERE s.query = 'UPDATE pgbench_branches SET bbalance =
bbalance + $1 WHERE bid = $2';

bench=#

I think it would be good if you show the output of
pg_stat_statements_reset statement instead of showing empty line.
Another minor point is that in the second statement
(pg_stat_statements_reset), you seem to have made it a two-line
statement whereas first one looks to be a single-line statement, it
would be good from the readability point of view if both looks same.
I would prefer the second to look similar to the first one.

-- 
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Kyotaro HORIGUCHI
Дата:
Сообщение: Re: Improve selectivity estimate for range queries
Следующее
От: Ryan Lambert
Дата:
Сообщение: Re: Installation instructions update (pg_ctl)