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 1tz5m2-00EuVq-2f for pgsql-general@arkaria.postgresql.org; Mon, 31 Mar 2025 03:25:18 +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 1tz5m0-00GybE-OS for pgsql-general@arkaria.postgresql.org; Mon, 31 Mar 2025 03:25:16 +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 1tz5io-00GtDh-Ut for pgsql-general@lists.postgresql.org; Mon, 31 Mar 2025 03:21:58 +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 1tz5in-0023z6-0V for pgsql-general@postgresql.org; Mon, 31 Mar 2025 03:21:58 +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 52V3LrjF3753581; Sun, 30 Mar 2025 23:21:53 -0400 From: Tom Lane To: David Rowley cc: Renan Alves Fonseca , Evgeny Morozov , pgsql-general Subject: Re: Querying one partition in a function takes locks on all partitions In-reply-to: References: <01020195b987abd3-a008b77d-8c63-4931-80a4-be36a351c8b2-000000@eu-west-1.amazonses.com> <01020195dd9e8337-c912f36d-54ef-4d3c-a00d-5e697b308d33-000000@eu-west-1.amazonses.com> Comments: In-reply-to David Rowley message dated "Mon, 31 Mar 2025 16:10:21 +1300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3753579.1743391313.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 30 Mar 2025 23:21:53 -0400 Message-ID: <3753580.1743391313@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk David Rowley writes: > On Sat, 29 Mar 2025 at 10:30, Renan Alves Fonseca > wrote: >> Currently, in the SQL function path the plan is always generic. The >> planner ignores the function arguments. The plan_cache_mode setting >> has no effect in this path. >> I agree that the docs should be more explicit about this. There is a >> high penalty for using generic plans in complex functions. > If you have any suggestions about where you think those should be > added or wording for that, please feel free to suggest. The issue's likely to be moot very shortly [1]. Maybe somebody will be excited enough to consider changing the docs in the back branches. But since it was like this for a couple of decades, I bet not. regards, tom lane [1] https://www.postgresql.org/message-id/flat/8216639.NyiUUSuA9g%40aivenl= aptop