Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1vGBFV-009SBk-I7 for pgsql-hackers@arkaria.postgresql.org; Tue, 04 Nov 2025 07:14:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1vGBFU-00BhBI-6t for pgsql-hackers@arkaria.postgresql.org; Tue, 04 Nov 2025 07:14:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1vGBFT-00BhB8-SA for pgsql-hackers@lists.postgresql.org; Tue, 04 Nov 2025 07:14:34 +0000 Received: from fhigh-a3-smtp.messagingengine.com ([103.168.172.154]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vGBFQ-005tB6-1X for pgsql-hackers@lists.postgresql.org; Tue, 04 Nov 2025 07:14:34 +0000 Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfhigh.phl.internal (Postfix) with ESMTP id 7AD6F1400294; Tue, 4 Nov 2025 02:14:31 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Tue, 04 Nov 2025 02:14:31 -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:subject :subject:to:to; s=fm3; t=1762240471; x=1762326871; bh=rhBw5ZsBCP q8cdBQqnr5a8EBU9dRg7+TlXr85AnbdhU=; b=xb6KcdEVTA7/YCQ2QrGubE7in2 OYVwpVL91uNTs+gwGUkIcKxuUe7xShqew0jHsbyxaxaEyS3SUyUGRmRwCY1xQ7Yn gu/uG1zLzAOBzbIxbOoGPHmU9PsLHZ4yQQlSLNAoqDdzSi1YCRgzoYL231GWPB+D 3Jrik85rAptH/uEMhl8wukUPbwUi5jI83EzIErZTWzVUQ1fNgW8U501mJOzxPUy8 hr/8M5PVi0I9gDdlwcqJtFubXrOoRVdKtPo3FL1lvcfDCBQAcGRRAL86qIMY5J8D J3qsgNakQi0hJneR87YHIU0lgu27KUfIc7ixye1/hZ1zwbXJWBwEwPoFPveA== 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:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1762240471; x=1762326871; bh=rhBw5ZsBCPq8cdBQqnr5a8EBU9dRg7+TlXr 85AnbdhU=; b=O/moc4lKJIFkJaEeCZZTbHPF9NikTz+6z8m8hDQW9Y4QcmoDHpg gzKf1E4gixXfNu+HkMr+MqGjXawECUh5fcAi9kxWfrATn7VD/pbD6byzOiYYbDRa eV+cdp52R9+45G4AH+YqSpb6L//w9tHRiBrsWc1INDiCyTaeB8zdtzBrcrhRn4Hc mjx/TBxm5WQYFiWjvs0b6uSoTK8U6uhoBJMZ3sRyOuL9cdfglDX202l8ikvZJqNj 2CwI8ICzhLsnld7h64N2wutBxewn+WNyz6dilzNLHsKj1LlAdq8Bys4iE0lHw60G kPiFvWWcWnHV56r7eOZce5czv4z6oN9Ltzg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddukedtfeekucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrh hlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredttddv necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeggeeg fffhkeeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiidp nhgspghrtghpthhtohephedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepthhomh grshesvhhonhgurhgrrdhmvgdprhgtphhtthhopegtohhrvgihrdhhuhhinhhkvghrsehg mhgrihhlrdgtohhmpdhrtghpthhtohepjhhirghnrdhunhhivhgvrhhsrghlihhthiesgh hmrghilhdrtghomhdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehlihhsthhs rdhpohhsthhgrhgvshhqlhdrohhrghdprhgtphhtthhopehtghhlsehsshhsrdhpghhhrd hprgdruhhs X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 4 Nov 2025 02:14:29 -0500 (EST) Date: Tue, 4 Nov 2025 16:13:55 +0900 From: Michael Paquier To: Tomas Vondra Cc: Corey Huinker , jian he , pgsql-hackers@lists.postgresql.org, tgl@sss.pgh.pa.us Subject: Re: Extended Statistics set/restore/clear functions.[ Message-ID: References: <439a9947-e6a1-4ea9-84d8-1f843deaf6b1@vondra.me> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="X+RxfDdQ3J71uiXA" Content-Disposition: inline In-Reply-To: <439a9947-e6a1-4ea9-84d8-1f843deaf6b1@vondra.me> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --X+RxfDdQ3J71uiXA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 31, 2025 at 09:22:55PM +0100, Tomas Vondra wrote: > Sorry for not paying much attention to this thread ... It was PGEU last week, it's not surprising knowing that you are in.. Europe :) > My opinion is that we should both use the new format and keep the > pg_dump code to allow upgrading from older pre-19 versions. Okay, thanks for the input. > There really is nothing special about the current format - I should have > used JSON (or any other established format) from the beginning. But I > only saw that as human-readable version of ephemeral data, it didn't > occur to me we'll use this to export/import stats cross versions. So if > we need to adjust that to make new use cases more convenient, let's bite > the bullet now. >=20 > If doing both is too complex / ugly, I think the pg_upgrade capability > is more valuable. I'd rather keep the old, less convenient format to > have pg_upgrade support for all versions. Hmm. I have been eyeing at the dump code once again, and it's not that bad on a second lookup, so I'd be OK to incorporate the whole in a review. > Otherwise users may not benefit from this pg_upgrade feature for a > couple more years. Plenty of users delay upgrading until the EOL gets > close, and so might be unable to dump/restore extended stats for the > next ~5 years. Okay. I still think that we should split things a bit more in the patch set. Corey has sent me a proposal in this direction, where most of the entries can be reviewed and potentially applied separately: 1. pg_ndistinct output function change. 2. pg_ndistinct input function addition. 3. pg_dependencies output function change 4. pg_dependencies input function 5. Expose attribute statistics function and rename them attstat_* or statatt_* 6. pg_restore_extended_stats 7. pg_dump with no ability to fetch old-format pg_ndistinct/pg_dependences. 8. pg_dump working back as far as possible I am not completely sold about the changes in the input/output functions, but I'd be happy to consider more options with a rebased patch set (with the dump issue on older clusters issue, while on it). -- Michael --X+RxfDdQ3J71uiXA Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmkJp7MACgkQnvQgOdby QH0b+Q/9G4eMgFSRG0hW2x5zeiPOVGAn7AtI2vtT9bSBtEyrPgmneP6WRxOQrnpn r/1kI0d66NKM83F2Zv5Pds297oNoW5eNRDq8UgCIBH1dh57zjemGS8fhOV0jZnhe VItoqBA4Ht4CsHqdvDAz8+Hd3YO05r1QTY3yz4J8dcmNlrpgO+rrak5/rWsFnUd9 eAuDOFHGMYBbDB1KEmcMGTQiYaZlFR9jmhdvDDDgBeRl+82d/OkDMXJ7kMGjU5n6 vyojicQMr/3c4hVg3xccU1l/hrQ+2e4Cpgw/f2TN0AM+GdVCYe7ey3I47af4l6CC SQTeFOlTnCmfrMlAAJ/D1MwrS42s0NDCQAIUt6d0OZGXclkGaqT+NkO08q8mv4Go H7ZBZTccmnxbrrfcu61dNLFfdS0Gr+w9rWFAhbqk+LRjsV7oXndPUb4uvnZ8reQE 6nDpRfWzBez/W1P0GIQU4e7KUir7Ok3vIvIb8oVejDdfgf8OABtbToru51MvbYKW i+df05ye+gkqMcVed+gm6eLxzV85FTR96HWPiAQB2mbwbAzfBzMHKrGxAZuXzhS9 pJxlYLOCRWplY7dVGmIxDMy8nhBp8jUEucZjVYYSrg3+Fjy4kK0mRJjU/1YqQ7NP EyUcVotOxJiAvMdeIsyYISVFlVdVemEIzPyXMpGgCc/Kt+H+BMY= =I5j/ -----END PGP SIGNATURE----- --X+RxfDdQ3J71uiXA--