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 1pZrQM-0002X9-7u for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Mar 2023 10:53:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pZrQK-0000Pr-K1 for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Mar 2023 10:53:32 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pZrQI-0000Pe-Uz for pgsql-hackers@lists.postgresql.org; Wed, 08 Mar 2023 10:53:32 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pZrQB-0007pR-QZ for pgsql-hackers@postgresql.org; Wed, 08 Mar 2023 10:53:29 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 9E215320010B; Wed, 8 Mar 2023 05:53:20 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Wed, 08 Mar 2023 05:53:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type: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; t=1678272800; x=1678359200; bh=sf sRd4lywSFBJ5lTDRlKXtJHmhOpUTDRHLPNsXmEo5o=; b=NlV/xWM8XVAW2GdBCT Pkdk5Zf5OVlmhuhMjF9vHSPAhjB99Rr8DL1a/mxVbE/JvSiBEyV9fc+F462idREB NlnL5k9uBMrObFU2BzkGR42h/5fysCNZCzUNyukJhbviMLim2cNhN7ysG4Nl3WxN GsP3g1j5U+2EplyWii6mQzwaMDYIbyrT/PtYcVvL7yw4oS4WZIOlnPX1viIqSxMs SatTpi45WYNs+qYDaQoafGRmHVyTdT5JoF+xsK9RJo5btQXDRlgQY5MlY3jWeeYR p5h4dxEQpc7zVbPwCzDI0pqGjkuG4LlVNtQIlpOk6c1UXM8wEe4bzulqDe6BukW0 kLdQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id: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=fm1; t=1678272800; x=1678359200; bh=sfsRd4lywSFBJ 5lTDRlKXtJHmhOpUTDRHLPNsXmEo5o=; b=ppmdRuro6OH0LHWS6Fk0oPYMaBVIP 2tucqV7e75/WvBxvxQegk3jpeA77j/EdMCr6wYJy/rkuXsobaRFBF39faZiEFg6Z akIum3AYGVQHYYJ7TV3I2V55DUnavC1hnACNOUdCglHrhaS9+ZaHKcakW0XbzpLo LVhfbXu3/cUFF4/tR4kZbrUZzuuBqPwXqKjGvsM5PueQ26AFScmpxRkwIaHacqtK iaDZHZUD6CNfAUu7xJNOei1oITKmHMK5hkNy7Cj0i/5y6t8ivgleYp7zGmB2UJ17 13Py64NsetSYVlyZzLhQdcSFFA2lsUuld8NO/fnxtZrTwat2VMAwyG5Bg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdduvddgudekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdljedtmdenucfjughrpeffhf fvvefukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefoihgthhgrvghlucfrrghq uhhivghruceomhhitghhrggvlhesphgrqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvg hrnhepteelieefudffhffhtdetleeggeegfffhkeeuveetiefgudduvedutefggeeivdej necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhhitg hhrggvlhesphgrqhhuihgvrhdrgiihii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 8 Mar 2023 05:53:18 -0500 (EST) Date: Wed, 8 Mar 2023 19:53:13 +0900 From: Michael Paquier To: Bharath Rupireddy Cc: Kyotaro Horiguchi , boekewurm+postgres@gmail.com, melanieplageman@gmail.com, pgsql-hackers@postgresql.org, pg@bowt.ie Subject: Re: Add pg_walinspect function with block info columns Message-ID: References: <20230307.111745.676528378431466705.horikyota.ntt@gmail.com> <20230307.154902.1060895277048303254.horikyota.ntt@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="4F5ZFhAALAaw8FUo" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --4F5ZFhAALAaw8FUo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Mar 08, 2023 at 04:01:56PM +0530, Bharath Rupireddy wrote: > I understand that performance is critical here but we need to ensure > memory is used wisely. Therefore, I'd still vote to free at least the > major contributors here, that is, pfree(raw_data);, pfree(raw_page); > and pfree(flags); right after they are done using. I'm sure pfree()s > don't hurt more than resetting memory context for every block_id. Okay by me to have intermediate pfrees between each block scanned if you feel strongly about it. > I think we need to output block data length (blk->data_len) similar to > fpilen to save users from figuring out how to get the length of a > bytea column. This will also keep block data in sync with FPI info. length() works fine on bytea, so it can be used on the block data. fpilen is a very different matter as it would be the length of a page without a hole, or just something compressed. -- Michael --4F5ZFhAALAaw8FUo Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmQIaRkACgkQnvQgOdby QH2Aug//W/mp66tShv3bK+FYGdbaqufU9XWC4nPs84iJQ8NRCZcVvFHCMnYCfvl0 9x1wzJWwLGEMqugljakpy6kaXnUJ4jXuN7/aDavfHnQJsFX5TKV3/Z95J5JPQYG0 nSH3JWNIOXS+dWAof4phi8CUeN9BK4gTn+C1imz5kRTwMyQ9SEx4jkU5zCmJgjX6 r8uNbA+LeLHWI+UcqCtUzd/J2oilxg6AQmYywFxuMjh+FUyB/yHaI7+5q5iAS3zp UE46V6rELIDVaW1syp6skaIlJV8UffKfjS2TLURgvDUgUX/tx3BNMD0HZpaPtqmS jwq+yan2yCiBXrjgjq+2e8SAcOJeKl7TVGYLux3ILccqYFyDHTRYqHVsOU+b/Rgx BSx6CacV5u0e3shJHtxXCcocLFMZyWS/GcBvfuki0LYlGWzir9uOFVQodRmFeFKd m0LduV3E/K4TBUuoIGiQpx4dbwf+rZfYbVqcZrMYBvHUQlr9kVmO1qDjtmAYPAZz 23Zh2hDi4lR8jTDq9gq+xr+W5lA1c8vRjiHt7PgCsGcuI/zyoBJbx1B7eOe+dpTL GjrAv1UtKk5K4v+CTRWcCp+VXxlhmbD2HY56fHuozNKc7gxZo+NRSReXHtwIN9cm xX8cEqVflgNiUmrvi7zzSrjQ55mkjdzWs9B++D3zo5xyKAF7Yd8= =Prt6 -----END PGP SIGNATURE----- --4F5ZFhAALAaw8FUo--