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.96) (envelope-from ) id 1vLCUe-007yYR-24 for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Nov 2025 03:35:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vLCUd-003hxa-0t for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Nov 2025 03:34:59 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vLCUc-003hxS-0z for pgsql-hackers@lists.postgresql.org; Tue, 18 Nov 2025 03:34:59 +0000 Received: from fout-a3-smtp.messagingengine.com ([103.168.172.146]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1vLCUa-00068l-0Y for pgsql-hackers@lists.postgresql.org; Tue, 18 Nov 2025 03:34:57 +0000 Received: from phl-compute-11.internal (phl-compute-11.internal [10.202.2.51]) by mailfout.phl.internal (Postfix) with ESMTP id A770BEC00D2; Mon, 17 Nov 2025 22:34:55 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-11.internal (MEProxy); Mon, 17 Nov 2025 22:34:55 -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=1763436895; x=1763523295; bh=GcZO5X4uyt sN+thf1zKFmAvjZ+xXF/HRPMEOLZHhddI=; b=pVnVdH6/Rji8IzMZw9Vi4WVdd0 UzOdyMR1tTZjZjG15liJzvLqcC2cM2GIi9LIoOkXu1TFkpof0APJywRjj59p9Fb9 Rzqdm+0Yo9itmB0eGuZXSmvacZSfRh7QeqpUuorKQarRNOGlfs1unED6YGqAwa6e m+YUj4oi7+gbBnEPx7WDtJjVpbVfxeKIkkzA/xspw9dbI/VjACfvPeg9t8ePbvzt epN+Kp4upsXW3j7e6IJe1fcslZhz51im7W+HlEaMdfWzbFYIF+s5Ybj/H8lYkhjj frUBixuixixbI7Ta3LmcqsSP88gqbpvLzCVtIFpl8QgQGyATjWDgvmrWHQ9g== 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= 1763436895; x=1763523295; bh=GcZO5X4uytsN+thf1zKFmAvjZ+xXF/HRPME OLZHhddI=; b=W6drDxWy0LYojUzyQxDbZHs+s0AfAqb90UHv5kaiY9va1mRShLI vwlnpxvC9Zf99ooEj6oFkq1MHDfU71Gb8njjxE9h9G0D2gdK35fyoTrnjC4RLb9z LD0nnsubqRlqxOZJJLzdWF/LXK0ItLks7dwd7tuKgE9jhhhRp1LJF4sLItTYeDQH UFKipjyEkh8yLjs+LmS/98ZEF4RuRQwA3PTMefUrHT8y0N/jIQKC7kG07iMX3rLz hIuIlIETY+v7E39cs0Jh0jeHMktgeOQpfr/PPXsKzWPZofN5FVewRaV9ckzvwe4T 9zk3sC3vsucMdAppURWUeYzywLRcBw67vyA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddvvddtvdekucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrh hlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredttddv necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeggeeg fffhkeeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiidp nhgspghrtghpthhtohephedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtoheptghorh gvhidrhhhuihhnkhgvrhesghhmrghilhdrtghomhdprhgtphhtthhopehjihgrnhdruhhn ihhvvghrshgrlhhithihsehgmhgrihhlrdgtohhmpdhrtghpthhtohepthhomhgrshesvh honhgurhgrrdhmvgdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehlihhsthhs rdhpohhsthhgrhgvshhqlhdrohhrghdprhgtphhtthhopehtghhlsehsshhsrdhpghhhrd hprgdruhhs X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 17 Nov 2025 22:34:53 -0500 (EST) Date: Tue, 18 Nov 2025 12:34:29 +0900 From: Michael Paquier To: Corey Huinker Cc: jian he , Tomas Vondra , pgsql-hackers@lists.postgresql.org, tgl@sss.pgh.pa.us Subject: Re: Extended Statistics set/restore/clear functions. Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="exmKyYFTA1M18xbe" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --exmKyYFTA1M18xbe Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 17, 2025 at 09:32:37PM -0500, Corey Huinker wrote: > So I looked at the generator functions, hoping they'd have enough in comm= on > that they could be made generic. And they're just different enough that I > think it's not worth it to try. >=20 > But, if we don't care about the order of the combinations, I also don't > think we need to expose the functions at all. We know exactly how many > combinations there should be for any N attributes as each attribute must = be > unique. So if we have the right number of unique combinations, and they're > all subsets of the first-longest, then we must have a complete set. > Thoughts on that? >=20 > Getting _too_ tight with the ordering and contents makes me concerned for > the day when the format might change. We don't want to _fail_ an upgrade > because some of the combinations were in the wrong order. That's fair. The planner costing code pulling the stats numbers based on the attributes was smart enough to not care much about the ordering as far as I recall, but I'd rather make sure of that first. This needs some careful lookup. >> These don't make sense anyway because they have a predictible and >> perfectly matching correlation relationship. >> >=20 > They do, for now, but are we willing to lock ourselves into that forever? Perhaps not. I cannot say for sure what's the future is going to be made of. > Looking over those functions, they both could have use the same generator, > but the dependencies-side decided that dependency order doesn't matter, > which puts doubt in my head that the order is perfectly the same for both, > so we'd better follow each individually IF we want to enforce order. I'd try to look at the bits related to pg_dependencies and pg_ndistinct as two separate concepts, at the end. They're sort of alike, but have too many differences already. -- Michael --exmKyYFTA1M18xbe Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmkb6UUACgkQnvQgOdby QH3gaA/9F/zv9LBxiwcJ0AZ7Ler27z/DkJgBjVi8JBJu6vljeV+R6JiI6m8joE/j FnoKeENdrZ0+93EGmV9TZn/8Z2RWDoFsQMLcZRdt4mG8WvDHZcML8x+k+xL50/Eu eII/IXERnBQw+JhNmozCNF8rAPtOmUt0rkQAqQSEcE9/8koHozG13Vx+w/bUde33 kKevn+n3AoqaUJ3NooVY1I6zY6knrKWA4FIOiAtQgKJuPBdkOxYsdIPja5MmUdC1 zIxQryj7Mei8hbNI5sOwMaakhfzUgJEUnHhNJHxliL9XG4zks+B9FZoYu+5kpiE1 1rGQFdN5xDZHtojKVfog34+V73xksNfBLVeUn4KaVLYlf06a3T/VzC6XZPTxl1fn Ve/dJfIrua4QNYZdENE88Kyqg6KV6uTtv4Z0rk2TeWr+8TZcD3CR4jcIX3N+cOJD Za8XRWjjSJpY2LeBGloe4RAsIeCVf49i6sG7GLu6yKIoBlKGm5n8oX5vPoZmWoQy c0+RvHeS/Dm6mroilIdUZ62GRsPDTAbIpC45tCj2ak9Mer9pxbeZAglwCGp9f6LD LFB8EmSAEJYCCopiF3Jb3y+M6BJRR/qZplzBRXDRje6S2TQJz6VGgVpGIiqdQ4IC BjwvI0jBb32l0EXcKpV337ASJg2mYWb3hOkSMpW2Y2Yc/cQi2OA= =UppY -----END PGP SIGNATURE----- --exmKyYFTA1M18xbe--