pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dominique Devienne <ddevienne@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Does PostgreSQL do bind-peeking? Is `col like '%'` optimized-away by the planner?
Date: Fri, 21 Jan 2022 12:22:56 -0500
Message-ID: <1194676.1642785776@sss.pgh.pa.us> (raw)
In-Reply-To: <CAFCRh-9pxkA=yiSvQZ8F84PphOStyEE7XHcaYjZyOb4EyO+xxQ@mail.gmail.com>
References: <CAFCRh-_3d5M=betpuTgU5JMtDTMbXVGZJYwh+S-k3cMQFqvNug@mail.gmail.com>
	<1191689.1642783673@sss.pgh.pa.us>
	<CAFCRh-9pxkA=yiSvQZ8F84PphOStyEE7XHcaYjZyOb4EyO+xxQ@mail.gmail.com>

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





view thread (5+ messages)

Message-ID: <1194676.1642785776@sss.pgh.pa.us>
Permalink:  ../1194676.1642785776@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1194676.1642785776@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, ddevienne@gmail.com
  Subject: Re: Does PostgreSQL do bind-peeking? Is `col like '%'` optimized-away by the planner?
  In-Reply-To: <1194676.1642785776@sss.pgh.pa.us>
  References: <CAFCRh-_3d5M=betpuTgU5JMtDTMbXVGZJYwh+S-k3cMQFqvNug@mail.gmail.com> <1191689.1642783673@sss.pgh.pa.us> <CAFCRh-9pxkA=yiSvQZ8F84PphOStyEE7XHcaYjZyOb4EyO+xxQ@mail.gmail.com> <1194676.1642785776@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox