Re: parameterized LIKE does not use index - Mailing list pgsql-performance

From Bruno Wolff III
Subject Re: parameterized LIKE does not use index
Date
Msg-id 20050623141854.GA7505@wolff.to
Whole thread Raw
In response to Re: parameterized LIKE does not use index  (Kurt De Grave <Kurt.DeGrave@student.kuleuven.ac.be>)
Responses Re: parameterized LIKE does not use index  (Josh Berkus <josh@agliodbs.com>)
List pgsql-performance
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.

pgsql-performance by date:

Previous
From: Frank Wiles
Date:
Subject: Re: Performance Tuning Article
Next
From: Michael Stone
Date:
Subject: Re: Performance Tuning Article