Re: [HACKERS] [tiny doc fix] statistics are not retained across immediate shutdown
Applied. --- On Wed, Sep 4, 2013 at 04:11:09AM +, Tsunakawa, Takayuki wrote: Hi, In the following page, statistics are kept across server restarts: http://www.postgresql.org/docs/current/static/monitoring-stats.html When the server shuts down, a permanent copy of the statistics data is stored in the global subdirectory, so that statistics can be retained across server restarts. However, statistics are not retained after immediate shutdown (pg_ctl stop -mi). You may say pg_ctl stop -mi is not a shutdown but an abort, so the sentence is not wrong, but it's an immediate shutdown and one mode of shutdown. I propose a tiny fix to clarify this. Please find the attached patch. I'd like this to be backported at least 9.2. Thanks. Regards, Takayuki Tsunakawa diff -rpcd a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml *** a/doc/src/sgml/monitoring.sgml2013-06-25 03:55:41.0 +0900 --- b/doc/src/sgml/monitoring.sgml2013-09-03 16:12:05.0 +0900 *** postgres: replaceableuser/ replacea *** 185,193 filenamepg_stat_tmp/filename by default. For better performance, varnamestats_temp_directory/ can be pointed at a RAM-based file system, decreasing physical I/O requirements. !When the server shuts down, a permanent copy of the statistics data is stored in the filenameglobal/filename subdirectory, so that !statistics can be retained across server restarts. /para /sect2 --- 185,195 filenamepg_stat_tmp/filename by default. For better performance, varnamestats_temp_directory/ can be pointed at a RAM-based file system, decreasing physical I/O requirements. !When the server shuts down cleanly, a permanent copy of the statistics data is stored in the filenameglobal/filename subdirectory, so that !statistics can be retained across server restarts. When recovery is !performed at server start (e.g. after immediate shutdown, server crash, !and point-in-time recovery), all statistics counters are reset. /para /sect2 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers -- Bruce Momjian br...@momjian.ushttp://momjian.us EnterpriseDB http://enterprisedb.com + Everyone has their own god. + -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Re: [HACKERS] [tiny doc fix] statistics are not retained across immediate shutdown
On 2013-09-04 10:53:19 -0400, Tom Lane wrote: Tsunakawa, Takayuki tsunakawa.ta...@jp.fujitsu.com writes: I propose a tiny fix to clarify this. Please find the attached patch. That's not an accurate description of what happens, though. AFAIR, we do not throw away pg_stats files as a result of recovery. StartupXLOG() does a pgstat_reset_all() in the if (InRecovery) branch. Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Re: [HACKERS] [tiny doc fix] statistics are not retained across immediate shutdown
Tsunakawa, Takayuki tsunakawa.ta...@jp.fujitsu.com writes: I propose a tiny fix to clarify this. Please find the attached patch. That's not an accurate description of what happens, though. AFAIR, we do not throw away pg_stats files as a result of recovery. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Re: [HACKERS] [tiny doc fix] statistics are not retained across immediate shutdown
On Wed, Sep 4, 2013 at 11:56 PM, Andres Freund and...@2ndquadrant.com wrote: On 2013-09-04 10:53:19 -0400, Tom Lane wrote: Tsunakawa, Takayuki tsunakawa.ta...@jp.fujitsu.com writes: I propose a tiny fix to clarify this. Please find the attached patch. That's not an accurate description of what happens, though. AFAIR, we do not throw away pg_stats files as a result of recovery. StartupXLOG() does a pgstat_reset_all() in the if (InRecovery) branch. Yes. And this causes one problem that the statistics data would be reset at the start after the clean shutdown of the standby server. Regards, -- Fujii Masao -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
[HACKERS] [tiny doc fix] statistics are not retained across immediate shutdown
Hi, In the following page, statistics are kept across server restarts: http://www.postgresql.org/docs/current/static/monitoring-stats.html When the server shuts down, a permanent copy of the statistics data is stored in the global subdirectory, so that statistics can be retained across server restarts. However, statistics are not retained after immediate shutdown (pg_ctl stop -mi). You may say pg_ctl stop -mi is not a shutdown but an abort, so the sentence is not wrong, but it's an immediate shutdown and one mode of shutdown. I propose a tiny fix to clarify this. Please find the attached patch. I'd like this to be backported at least 9.2. Thanks. Regards, Takayuki Tsunakawa stats_reset_in_recovery.patch Description: stats_reset_in_recovery.patch -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers