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 1wTv2p-000pdE-2U for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Jun 2026 05:18:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wTv1p-008vD9-0S for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Jun 2026 05:17:33 +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.96) (envelope-from ) id 1wTv1o-008vCs-0x for pgsql-hackers@lists.postgresql.org; Mon, 01 Jun 2026 05:17:33 +0000 Received: from fout-b1-smtp.messagingengine.com ([202.12.124.144]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wTv1g-00000000bEW-2z0Y for pgsql-hackers@lists.postgresql.org; Mon, 01 Jun 2026 05:17:27 +0000 Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfout.stl.internal (Postfix) with ESMTP id 9D3CC1D00161; Mon, 1 Jun 2026 01:17:21 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-02.internal (MEProxy); Mon, 01 Jun 2026 01:17:21 -0400 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=1780291041; x=1780377441; bh=G6SAagjQXI ejgrbLcp5j+uQ/99BWf7WTHG+sV0y+65g=; b=Szm4g6Y7O6Qkr0iGR0+mQwyeoX DnFXrDvtyf1Jzh2WpgY7SdpGn7iIEZ/YcppaZBX6iGkgt1m9rb1spc7SyJ8LvqXa zsnMNaE8SkJxfIo0Xq7TcUBsgK+xgCwpUGyEcZ47tLFft5aKZdj5Z7qoH6HZPutc c6lOLgj8P5wGxTHzD66faEk4MoxJZEVMCThdRv2vdk8G6gPMJqEMvzRou/L6Qwui S8tgR2UUsVbFAdqCWsSpPkiPQCT2hRjKpRuf8a4f2M/m16nAPWGT2A/jluESgjk2 ceL4XeJnRoEBtRDRtXClPf5Ozk2sZJ338+tm47+PeoA7m0PWrG0FYOEAQn2Q== 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= 1780291041; x=1780377441; bh=G6SAagjQXIejgrbLcp5j+uQ/99BWf7WTHG+ sV0y+65g=; b=ar0AzQmFSCkDaeyRZdQwmLLtxtOS2PfA9p9kxob8Yl2L8HQ2aQA BYjR2cxJ4DV1VvemsTLiEug4htdsTbxxeo2+5vbBg4JPLYO3fg6bNnLq5StCKpDh DIFSreYkq1jxu3Cweu6osY6EaCMMAjZtLSsVFQ5VY1tkeJcMoeTzQbu+yEjPsmin OUR342aBwDxVPiSotkxdLaz+zpEnAzlkDMI0C72TpZtl9wRA+eoswnO9Xs5Vz04V XnwurJ1ayz2QF1TfrDMbXx24fzc4JAjz6PBs8dB8ZDcdBwVu0CK5nMkwL4d42Xrj /i2aVXI5tDVtc0o0sQ8DQsNvghTAPqA9IbQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTEOtOz2zi+SOwBFdPhBHmLOQ/ERwG4eJ0gcX/7ZtnfgTIT5/Dg21Fi//IsH+smBK6 Ww2E5f3Foss3Z6lFwk439AmTTdZ8F+bZaCQdaWlUp1f/L0Fa8Syyeh8dI0Z7CPkkYyvByr P7ZitfPK5vN/y2LofNbj//WAOYNk1mzvs5ZAox9ISQk1m4+XE3MwpC2GePWIcEAh1OnIo6 LbqPYQVv6DBz9R3XBd1dL5ObN4r3JDzYqCGjmkzpL5D7g85pF4eVmD8Ik8E6QtskrZ+Du2 CW8mOQAxQ9Nz6fwk+h5yjOqLU1aYzDi54bfI+rDBlawywQD1/qLn1/66ccPmfv06qt/WZB jA22UEnPFRItmHxDWdq5IJn4jFvfj8CDIYkgiDV3JBCcaqkZwIx8G0ONlGzEo2Xx7CLIFd hKLBN4oB9tJ4YMrljh5XXHw2nydHc82Ks9ue3vqNrdKfN0Wxl0xIzx6LFSKJkI5WJNpP0N ppwHZhFtV/dfVWM44gShNYecYwOhGXvlBqxhtZPTQ9KhtUfpLevJYVd4G3kL61RZQ1Dv1U vK+CabsZihNMl2ANGC7cFm9TQpMlW+3OcTLmPWSj5M8HmBMQ9kHJT20my8ArP7saLk31jZ +JH9xjvP8TNGkP/i2vMHovnsZmOlJYOStJKMWjLOuQvhekboqYW/RH7YjDTw X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 1 Jun 2026 01:17:19 -0400 (EDT) Date: Mon, 1 Jun 2026 14:17:16 +0900 From: Michael Paquier To: Denis Rodionov Cc: pgsql-hackers@lists.postgresql.org Subject: Re: [PATCH] Remove obsolete tupDesc assignment in extended statistics Message-ID: References: <4cb9e2ae-9ac4-4e2d-a840-c4accb9d105d@tantorlabs.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="eDV5ZFHeP46BaW8H" Content-Disposition: inline In-Reply-To: <4cb9e2ae-9ac4-4e2d-a840-c4accb9d105d@tantorlabs.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --eDV5ZFHeP46BaW8H Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 28, 2026 at 06:58:39PM +0300, Denis Rodionov wrote: > lookup_var_attr_stats() assigns tupDesc to VacAttrStats entries created f= or > expressions. That appears to be obsolete: make_build_data() uses tupDesc > only when fetching values for regular columns, while expressions are hand= led > separately using VacAttrStats entries created by examine_expression(). >=20 > The old comment also points at statext_mcv_build(), but this does not seem > to match the current code anymore. If some future code needs a tuple > descriptor for expression entries here, it should probably set up that > dependency explicitly rather than rely on copying vacatts[0]->tupDesc. >=20 > The patch removes the assignment and the outdated XXX comment. I got this code under my eyes a couple of weeks ago for a bug fix, and wondered the same thing as you here, but I never got down to analyze where the TupleDesc is used. Could that be just an oversight of a4d75c86bf15 due to rebases of what has been committed? Perhaps we should enforce somewhere that a VacAttrStats.tupDesc is never set for an expression, in the shape of an assertion? I am not sure where I would plant that, or if it's required, but that would feel better than just removing these lines. -- Michael --eDV5ZFHeP46BaW8H Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmodFdwACgkQnvQgOdby QH1xXQ//ehKa5NBQLlCJ5tGKX4wxCx+MBG/idJa9Tv1L0ZQJwtmfrTnzMAX0ClLu cCwAQQuoWA/5XawcZ+CGmSGJBuRub5FPkQbODE4Q0zt4ti1R5tjneaY/Igf83saR YQsJW9OH13Dhdiss6B4S0yzE/VnKbVMcV/yndfq7gaSUpoqvBAtJBulkdDk/AlKJ ueiFoYH30jR545m9K+1gK8BcdNYqiKn/mV2VCkK7jDBII5qfXZnckm2Ptul3TMbL oHqjGcHjVU++jPf0M33xeZs9dxRvOcqr7tbv5jSC+CtjRzLukYp4tgCvI0oHRa2e qGsOIAA9QFbxtCKhEJXmTgPfbc/EJni7Mw7wzb2fcqzbohz9/+7/3pViNRlejnGW f0ZA9tjXe543ZuP1fRWwiuzbkcER6uaPLERBYXkq3YG9IGuJGgce8DwFOZ1NGrci fm0DEcc1G6GQoXTD7JGCkT4mp52rEx4eo8eV61B3ld2LQfOw9PJLEJeiQ5mKNMCb h5lkVZtwsoRA1YvnDPeBUj1BIm4oIz44n4lTK1YaSFy86Uwuh2W4rYYUWNQi7RzD KVZBPnIkHoC5EeF3Ejq6Gwn4co2TeAdSRXDI4mMpprizrjIQVEhixMtUutVWsru3 mcX6QbfjSFDInc+CCRKzVUSuzC4pqbpikYAPp/Pa0iy1nAbtLTo= =Ra09 -----END PGP SIGNATURE----- --eDV5ZFHeP46BaW8H--