Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nAxcr-0002sO-OC for pgsql-general@arkaria.postgresql.org; Fri, 21 Jan 2022 17:23:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nAxcq-0004pD-J6 for pgsql-general@arkaria.postgresql.org; Fri, 21 Jan 2022 17:23:00 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nAxcq-0004p4-8h for pgsql-general@lists.postgresql.org; Fri, 21 Jan 2022 17:23:00 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nAxco-0002IX-20 for pgsql-general@lists.postgresql.org; Fri, 21 Jan 2022 17:22:59 +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 20LHMu5Q1194677; Fri, 21 Jan 2022 12:22:56 -0500 From: Tom Lane To: Dominique Devienne cc: pgsql-general@lists.postgresql.org Subject: Re: Does PostgreSQL do bind-peeking? Is `col like '%'` optimized-away by the planner? In-reply-to: References: <1191689.1642783673@sss.pgh.pa.us> Comments: In-reply-to Dominique Devienne message dated "Fri, 21 Jan 2022 18:08:03 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1194675.1642785776.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 21 Jan 2022 12:22:56 -0500 Message-ID: <1194676.1642785776@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Dominique Devienne writes: > On Fri, Jan 21, 2022 at 5:47 PM Tom Lane wrote: >> There is a notion of "custom plans" in which parameter values are >> inserted as constants, precisely to allow simplifications based on >> known constant values. But this particular case isn't implemented. > Where can I read more about this? And is it something the client has > any influence on? Start here: https://www.postgresql.org/docs/current/sql-prepare.html https://www.postgresql.org/docs/current/plpgsql-implementation.html#PLPGSQ= L-PLAN-CACHING regards, tom lane