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 1uzghc-0069qC-Fa for pgsql-performance@arkaria.postgresql.org; Fri, 19 Sep 2025 19:23:28 +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 1uzgha-008ynz-CM for pgsql-performance@arkaria.postgresql.org; Fri, 19 Sep 2025 19:23:26 +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 1uzgha-008ynr-2R for pgsql-performance@lists.postgresql.org; Fri, 19 Sep 2025 19:23:26 +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 1uzghX-001Jri-2n for pgsql-performance@lists.postgresql.org; Fri, 19 Sep 2025 19:23:25 +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 58JJNMCR2157137; Fri, 19 Sep 2025 15:23:22 -0400 From: Tom Lane To: Matt Long cc: Mark Frost , "pgsql-performance@lists.postgresql.org" Subject: Re: Poor row estimates from planner, stat `most_common_elems` sometimes missing for a text[] column In-reply-to: References: <3e539c8b-c95a-4ba9-8462-04045b2da2b0@dalibo.com> <1751511.1749259794@sss.pgh.pa.us> <2194366.1752875645@sss.pgh.pa.us> <987464.1757374621@sss.pgh.pa.us> <1209259.1757445586@sss.pgh.pa.us> Comments: In-reply-to Matt Long message dated "Fri, 19 Sep 2025 11:26:59 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2157135.1758309802.1@sss.pgh.pa.us> Date: Fri, 19 Sep 2025 15:23:22 -0400 Message-ID: <2157136.1758309802@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Matt Long writes: > I finally got around to testing your patch on a realistic data set. In > short, the patch worked beautifully even with the division by 2 removed. In > case it's helpful, the full write up of my investigation can be found at > https://gist.github.com/mattlong/0617bec6e1cf5bc6b70c6c2951901df7 Thank you! I'm now inclined to keep the divisions by 2 (with comment fixes). regards, tom lane