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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dominique Devienne <ddevienne(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Does PostgreSQL do bind-peeking? Is `col like '%'` optimized-away by the planner?
Date: 2022-01-21 17:22:56
Message-ID: 1194676.1642785776@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dominique Devienne <ddevienne(at)gmail(dot)com> writes:
> On Fri, Jan 21, 2022 at 5:47 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alanoly Andrews 2022-01-21 18:04:57 RE: Using a different column name in a foreign table
Previous Message Dominique Devienne 2022-01-21 17:08:03 Re: Does PostgreSQL do bind-peeking? Is `col like '%'` optimized-away by the planner?