[HACKERS] [PATCH] Make sure all statistics is sent after a few DML areperformed

Поиск
Список
Период
Сортировка
От Yugo Nagata
Тема [HACKERS] [PATCH] Make sure all statistics is sent after a few DML areperformed
Дата
Msg-id 20170718214927.e2addf4a.nagata@sraoss.co.jp
обсуждение исходный текст
Ответы Re: [HACKERS] [PATCH] Make sure all statistics is sent after a fewDML are performed  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
Hi,

After a DML is perfomed, the statistics is sent to pgstat by pgsent_report_sent().
However, the mininum time between stas file update is PGSTAT_STAT_INTERVAL, so if
a few DMLs are performed with short interval, some statistics could not be sent
until the backend is shutdown.

This is not a problem in usual cases, but in case that a session is remained in
idle for a long time, for example when using connection pooling, statistics of
a huge change of a table is not sent for a long time, and as a result, starting
autovacuum might be delayed.

An idea to resolve this is call pgsent_report_sent() again with a delay
after the last DML to make sure to send the statistics. The attached patch
implements this.

Any comments would be appreciated.

Regards,

-- 
Yugo Nagata <nagata@sraoss.co.jp>

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Вложения

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

Предыдущее
От: Fabien COELHO
Дата:
Сообщение: Re: [HACKERS] merge psql ef/ev sf/sv handling functions
Следующее
От: Andres Freund
Дата:
Сообщение: Re: [HACKERS] [PATCH] Make sure all statistics is sent after a fewDML are performed