pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruno Wolff III <bruno@wolff.to>
To: Kurt De Grave <Kurt.DeGrave@student.kuleuven.ac.be>
Cc: Josh Berkus <josh@agliodbs.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: parameterized LIKE does not use index
Date: Thu, 23 Jun 2005 09:18:54 -0500
Message-ID: <20050623141854.GA7505@wolff.to> (raw)
In-Reply-To: <42BA73CE.4030909@student.kuleuven.ac.be>
References: <42BA73CE.4030909@student.kuleuven.ac.be>

On Thu, Jun 23, 2005 at 10:33:18 +0200,
  Kurt De Grave <Kurt.DeGrave@student.kuleuven.ac.be> wrote:
> 
> Now it's tempting to dream of some mechanism that could make the
> database consider
> replanning the query automatically once it knows the parameter, or
> choose from
> a set of plans depending on the parameter. In this case the general plan
> was about three orders
> of magnitude slower than the specialized plan. But I guess this case is
> not all that common
> and the developer can work around it.

I remember some discussion about delaying planning until the first
actual query so that planning could use actual parameters to do
the planning. If you really want to have it check the parameters
every time, I think you will need to replan every time. I don't
know if there is a way to save some of the prepare working while
doing this.



view thread (7+ messages)  latest in thread

Message-ID: <20050623141854.GA7505@wolff.to>
Permalink:  ../20050623141854.GA7505@wolff.to/
Also on:    postgresql.org/message-id/20050623141854.GA7505@wolff.to

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: bruno@wolff.to, Kurt.DeGrave@student.kuleuven.ac.be, josh@agliodbs.com
  Subject: Re: parameterized LIKE does not use index
  In-Reply-To: <20050623141854.GA7505@wolff.to>

* 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