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 1nbflD-0007gO-A6 for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Apr 2022 09:46:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nbflC-0006JX-5v for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Apr 2022 09:46:02 +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 1nbflA-0006Ed-KV for pgsql-hackers@lists.postgresql.org; Tue, 05 Apr 2022 09:46:01 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nbfl5-0008Q6-4h for pgsql-hackers@lists.postgresql.org; Tue, 05 Apr 2022 09:46:00 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id ED17B5C0172; Tue, 5 Apr 2022 05:45:51 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Tue, 05 Apr 2022 05:45:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; 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=+1ItCLxS9Fq/wB1sQZ1QATDgaydXxUDILz32vi mz3D8=; b=piiQBE1f7PLBjxQTSUF7nrezdV/kY27vfR2LOba/U1bH0SfqbqnQW6 R/ydJcKsFEN8izJA267Qg0kR6i2MThkTjvzQ2LkW8d0l7it5VJxfUcOgi1h/pOQB yhj0OI71+zc7Epm5EiqZd/CKoD6dFnDrRWkQHs7+p2gcv4/ibCT2/5+qxvvINrPS doF8bQFRXSe0jM7BpDtNSGPY1qJE43QdZKdKph9NBWvFO/zgFT1c3hspTmKZoAi7 9b92dVbuzG4DeZxNPKS3LVVIPcLvsQninqlPAFF/l9pKnzYfmuFRKXmPA5Y5PUVn yxFQUGzmiY051t2+jAET7GyapAzYhfhA== 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=+1ItCLxS9Fq/wB1sQ Z1QATDgaydXxUDILz32vimz3D8=; b=FJk7/rX9h0/gRUsQXzyO+bFIc+x4cW/HQ BZlCelqRvKQ0k7l3SUdDiBM8Rx70668aeaQOYCx1mvQnpGSLtY6hq7fItNv39TG+ f+zWjxj/6gb1pAKP2F4EQnfqW0szQupoW7VFu8gARHnMCIAZFt/J5dDkmkgalagh yYKAhyOUNK5yHfzvAqNMaFfqJYjMGecTbPpc3PDwODyoEZH+2fM9n764h/rnhZOI e9UU1St43CjGQam8xUQ2HFkMuBlbkIl2yBJA1sZ4UMoJnJ3KlwwLj9fueV3DK5AQ IeopUOSORskAG6iLftPiYAXXXMmMMAgazeK3BAs7TqNQ0ax9u7N5w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudejgedgudeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpedvgeduuefhtdeuleettdevjeeh heeiveeuieegleetgeeljeelieeuieehgeevhfenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 5 Apr 2022 05:45:48 -0400 (EDT) Date: Tue, 5 Apr 2022 18:45:44 +0900 From: Michael Paquier To: Andres Freund Cc: Nitin Jadhav , Bharath Rupireddy , Matthias van de Meent , Ashutosh Sharma , Julien Rouhaud , Bruce Momjian , Tom Lane , Magnus Hagander , PostgreSQL Hackers Subject: Re: Report checkpoint progress with pg_stat_progress_checkpoint (was: Report checkpoint progress in server logs) Message-ID: References: <20220319001556.atuqbmafvc73pa2k@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="VMa5z6qkzTF7AJUE" Content-Disposition: inline In-Reply-To: <20220319001556.atuqbmafvc73pa2k@alap3.anarazel.de> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --VMa5z6qkzTF7AJUE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 18, 2022 at 05:15:56PM -0700, Andres Freund wrote: > Have you measured the performance effects of this? On fast storage with l= arge > shared_buffers I've seen these loops in profiles. It's probably fine, but= it'd > be good to verify that. I am wondering if we could make the function inlined at some point. We could also play it safe and only update the counters every N loops instead. > This view is depressingly complicated. Added up the view definitions for > the already existing pg_stat_progress* views add up to a measurable part = of > the size of an empty database: Yeah. I think that what's proposed could be simplified, and we had better remove the fields that are not that useful. First, do we have=20 any need for next_flags? Second, is the start LSN really necessary for monitoring purposes? Not all the information in the first parameter is useful, as well. For example "shutdown" will never be=20 seen as it is not possible to use a session at this stage, no? There is also no gain in having "immediate", "flush-all", "force" and "wait" (for this one if the checkpoint is requested the session doing the work knows this information already). A last thing is that we may gain in visibility by having more attributes as an effect of splitting param2. On thing that would make sense is to track the reason why the checkpoint was triggered separately (aka wal and time). Should we use a text[] instead to list all the parameters instead? Using a space-separated list of items is not intuitive IMO, and callers of this routine will likely parse that. Shouldn't we also track the number of files flushed in each sub-step? In some deployments you could have a large number of 2PC files and such. We may want more information on such matters. + WHEN 3 THEN 'checkpointing replication slots' + WHEN 4 THEN 'checkpointing logical replication snaps= hot files' + WHEN 5 THEN 'checkpointing logical rewrite mapping f= iles' + WHEN 6 THEN 'checkpointing replication origin' + WHEN 7 THEN 'checkpointing commit log pages' + WHEN 8 THEN 'checkpointing commit time stamp pages' There is a lot of "checkpointing" here. All those terms could be shorter without losing their meaning. This patch still needs some work, so I am marking it as RwF for now. -- Michael --VMa5z6qkzTF7AJUE Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmJMD8gACgkQnvQgOdby QH0iQg//SLGakAR6mRMXn3gkF4dXGh1OgXCWVM2Kk6Ro5gPpNUB7CCJsRsEdsHr4 DLks3GK7oQPwDh8hOyeXpfoMyfp8b1PfB+E/oMBRMQioObRi9Ja3ZY1xJg6iTSiq FoHe1ZxfiLUwfotcrsZlj002rPzn4Dat1Rlffc7EUC/4FvP8dbMAheJWydTL/WFt J5tOQIXbUqqRYUrj3W3X1ZoxnqaIMEHZvWWo5R3wKIOEWMV41sucPTQ0z1ph+9T2 aBShX+RxBk6Kt+F5+XoV1ppuD/5m/FTohIb1jBO8rc5c7BAA1O5Qt4BYtQ9NYP3M NKBkiTY5qOtyF/h/MoroDWVTKuLdAQsMZeRfvAcURwtLPSG7Ha3giolrYs/Jziz1 gAXZuRyEsu/1rdtx3iZZDT5WygRx1vs0S/g6vBmGhOtk5L72cxBCOwGSpG/wlfQO Rghu0qYz4d6nCeRXdloHCUL8K3Yb3Z46+280jIM5lsl8u+DLHMvQGWhJJhTJL2yM PLD/w7r4oKoxxBs7PeDfOTMOHGrPjhrXpO3eurjZOArXzUZvlZhIj5jONWxMBAsZ gyv5QjJgKeIR5G6DeKM1y0cIBHNJ83ZJhu7eQjZ7z1B2pEVaKxxuVHcyndKJj8Mu 8nE64dHW7f3Ey+QnArxI/vCVfr+boOOWecOEvct3cTxeNEMUC6I= =gyq2 -----END PGP SIGNATURE----- --VMa5z6qkzTF7AJUE--