Re: Does PostgreSQL do bind-peeking? Is `col like '%'` optimized-away by the planner? - Mailing list pgsql-general

From Tom Lane
Subject Re: Does PostgreSQL do bind-peeking? Is `col like '%'` optimized-away by the planner?
Date
Msg-id 1194676.1642785776@sss.pgh.pa.us
Whole thread Raw
In response to Re: Does PostgreSQL do bind-peeking? Is `col like '%'` optimized-away by the planner?  (Dominique Devienne <ddevienne@gmail.com>)
List pgsql-general
Dominique Devienne <ddevienne@gmail.com> writes:
> On Fri, Jan 21, 2022 at 5:47 PM Tom Lane <tgl@sss.pgh.pa.us> 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#PLPGSQL-PLAN-CACHING

            regards, tom lane



pgsql-general by date:

Previous
From: Dominique Devienne
Date:
Subject: Re: Does PostgreSQL do bind-peeking? Is `col like '%'` optimized-away by the planner?
Next
From: Alanoly Andrews
Date:
Subject: RE: Using a different column name in a foreign table