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 1tn9cI-002ecc-Lz for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Feb 2025 05:05:54 +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 1tn9cG-00FNu9-VX for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Feb 2025 05:05:52 +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.94.2) (envelope-from ) id 1tn9cG-00FNu0-Jx for pgsql-hackers@lists.postgresql.org; Wed, 26 Feb 2025 05:05:52 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tn9cC-00082z-1Z for pgsql-hackers@lists.postgresql.org; Wed, 26 Feb 2025 05:05:51 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 51Q55iVU1707558; Wed, 26 Feb 2025 00:05:45 -0500 From: Tom Lane To: Corey Huinker cc: Jeff Davis , Andres Freund , Michael Paquier , jian he , Nathan Bossart , Bruce Momjian , Matthias van de Meent , Magnus Hagander , Stephen Frost , Ashutosh Bapat , Peter Smith , PostgreSQL Hackers , alvherre@alvh.no-ip.org Subject: Re: Statistics Import and Export In-reply-to: References: <3670503.1740173078@sss.pgh.pa.us> <3728741.1740178078@sss.pgh.pa.us> <97b451228227c555be1a4f79c4a62ddec9a74f06.camel@j-davis.com> <6af48508a32499a8be3398cafffd29fb6188c44b.camel@j-davis.com> <1698502.1740541206@sss.pgh.pa.us> <1704472.1740544569@sss.pgh.pa.us> Comments: In-reply-to Corey Huinker message dated "Tue, 25 Feb 2025 23:57:40 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1707556.1740546344.1@sss.pgh.pa.us> Date: Wed, 26 Feb 2025 00:05:44 -0500 Message-ID: <1707557.1740546344@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Corey Huinker writes: > Just to confirm, we ARE able to assume dense packing of attributes in an > index, and thus we can infer the attnum from the position of the attname in > the aggregated array, and there's no need to do a parallel array_agg of > attnums, yes? Yes, absolutely, there are no dropped columns in indexes. See upthread discussion. We could have avoided two sub-selects for attstattarget too, on the same principle: just collect them all and sort it out later. That'd risk bloating pg_dump's storage, although maybe we could have handled that by doing additional processing while inspecting the results of getIndexes' query, so as not to store anything in the common case. regards, tom lane