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 1uEXZI-009Xds-Bx for pgsql-performance@arkaria.postgresql.org; Mon, 12 May 2025 18:08:00 +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 1uEXZH-000RtA-2T for pgsql-performance@arkaria.postgresql.org; Mon, 12 May 2025 18:07:59 +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 1uEXZG-000Rt1-Od for pgsql-performance@lists.postgresql.org; Mon, 12 May 2025 18:07:58 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uEXZE-001Y3a-0E for pgsql-performance@lists.postgresql.org; Mon, 12 May 2025 18:07:58 +0000 Received: from pro.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 54CI7sjI1332136; Mon, 12 May 2025 14:07:54 -0400 From: Tom Lane To: Maxim Boguk cc: David Rowley , Andrei Lepikhov , Pgsql Performance Subject: Re: inefficient/wrong plan cache mode selection for queries with partitioned tables (postgresql 17) In-reply-to: References: <38201.1747063982@sss.pgh.pa.us> Comments: In-reply-to Maxim Boguk message dated "Mon, 12 May 2025 20:55:07 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <38868.1747073274.1@sss.pgh.pa.us> Date: Mon, 12 May 2025 14:07:54 -0400 Message-ID: <38869.1747073274@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Maxim Boguk writes: > Reading the code - probably the lowest hanging fruit is to make > 'The current multiplier of 1000 * cpu_operator_cost' configurable in the > future versions. I'm wondering whether we should try to make the planner not expend the effort in the first place, but leave partition pruning to the executor, at least in cases where it can determine that that will be possible. regards, tom lane