Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ncgN5-0003aP-NO for pgsql-hackers@arkaria.postgresql.org; Fri, 08 Apr 2022 04:37:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ncgN4-0005qL-Je for pgsql-hackers@arkaria.postgresql.org; Fri, 08 Apr 2022 04:37:18 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ncgN4-0005qC-Am for pgsql-hackers@lists.postgresql.org; Fri, 08 Apr 2022 04:37:18 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ncgMy-0002BQ-Au for pgsql-hackers@lists.postgresql.org; Fri, 08 Apr 2022 04:37:18 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 3CC5C5C01C4; Fri, 8 Apr 2022 00:37:11 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Fri, 08 Apr 2022 00:37:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; bh=N6aRGWRoNqrOum7OneBBgyY3uoQHCcVDnGFqEG D/PHA=; b=DMR1k3HhH4QFd2ln6Q9WSxQTdMYvwRMRifnUAuBDaG/elc6wQdn+XY eJu0cn25IYj4xMgrwKF8uwezJnmc44ADV5gCYB7m7o+vHbKwuIzr928i8QssdsQ3 udeme6iRw7Fj0Q1keSL+RIxR/PG1rKc7tBZmwvub/NHvEO+CdEPWIEJBKXOHYzZw IT+nVSANjUajnjvEsrK13s8RnRZOPu2JaETujX5yT7sKw+6boco8LuEWem91ydA+ TJxUrYVFU197dbl7NvmCpP+cRCpzQqE7MUpY3i+iY0NqYapZxeDRYdQlqc1Qp6rS 16se0imd4ZgL7Ipdj4f28SCRf3FYTyDA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=N6aRGWRoNqrOum7On eBBgyY3uoQHCcVDnGFqEGD/PHA=; b=H1mQCHaAsWXEWfUulhPMzSoYMzwRQNJwK ZM5Z27j1F8zEKAu+QTatImPKNIkZns3ZKAg7WKo6x8En3+9gh3wY17+TLynfUzl7 FVw2AinJSJuM2R2cHBwmQS+uS3EpGA3DzcW0tTMRa3bxID0zQr9SEBVJaeW7qtub vOhcJMUvHAq2oNGzRKTLOOheg/RD3ovzeSq17iT2Bo9SwrkD4A98fBUn+v4c533b ZKHcJgRRSsZLOq87HF2FSUZsDGWrAW7gb1rc4fj0y0IYR15U4lj91lGcvKh6Ivkf thGzpMAuK5RoDQAmCGzmqcqlEzIdJjBFHL8p2U8T2tE49VC0LN1Ew== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudejledgkeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuffkfhggtggujgesthdtre dttddtvdenucfhrhhomheptehnughrvghsucfhrhgvuhhnugcuoegrnhgurhgvshesrghn rghrrgiivghlrdguvgeqnecuggftrfgrthhtvghrnhepudekhfekleeugeevteehleffff ejgeelueduleeffeeutdelffeujeffhfeuffdunecuvehluhhsthgvrhfuihiivgeptden ucfrrghrrghmpehmrghilhhfrhhomheprghnughrvghssegrnhgrrhgriigvlhdruggv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 8 Apr 2022 00:37:10 -0400 (EDT) Date: Thu, 7 Apr 2022 21:37:09 -0700 From: Andres Freund To: Kyotaro Horiguchi Cc: melanieplageman@gmail.com, pryzby@telsasoft.com, thomas.munro@gmail.com, david.g.johnston@gmail.com, pgsql-hackers@lists.postgresql.org Subject: Re: shared-memory based stats collector - v70 Message-ID: <20220408043709.uml3s4ycrexi7bbq@alap3.anarazel.de> References: <20220406030008.2qxipjxo776dwnqs@alap3.anarazel.de> <20220407072845.mwz7ybaode32kk26@alap3.anarazel.de> <20220407233751.i573vgmuwicphd2t@alap3.anarazel.de> <20220408.111014.1139039683831064200.horikyota.ntt@gmail.com> <20220408035921.xlmjrv7wdmk3xm7k@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220408035921.xlmjrv7wdmk3xm7k@alap3.anarazel.de> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2022-04-07 20:59:21 -0700, Andres Freund wrote: > > > Cumulative statistics are collected in shared memory. Every > PostgreSQL process collects statistics locally > then updates the shared data at appropriate intervals. When a server, > including a physical replica, shuts down cleanly, a permanent copy of the > statistics data is stored in the pg_stat subdirectory, > so that statistics can be retained across server restarts. In contrast, > when starting from an unclean shutdown (e.g., after an immediate shutdown, > a server crash, starting from a base backup, and point-in-time recovery), > all statistics counters are reset. > > ... > > The cumulative statistics system is active during recovery. All scans, > reads, blocks, index usage, etc., will be recorded normally on the > standby. However, WAL replay will not increment relation and database > specific counters. I.e. replay will not increment pg_stat_all_tables > columns (like n_tup_ins), nor will reads or writes performed by the > startup process be tracked in the pg_statio views, nor will associated > pg_stat_database columns be incremented. > I went with these for now. My guess is that there's further improvements in them, and in surrounding areas... With that, I'll close this CF entry. It's been a while. Greetings, Andres Freund