Re: Speeding up LIKE with placeholders?

From: Dan Sugalski <dan(at)sidhe(dot)org>
To: Pierre-Frédéric Caillaud <lists(at)boutiquenumerique(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Speeding up LIKE with placeholders?
Date: 2004-09-11 19:00:04
Message-ID: a06110400bd68f8fd22da@[10.0.1.5]
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

At 12:30 PM +0200 9/11/04, Pierre-Frédéric Caillaud wrote:
> If I understand correctly your problem is
>that the plan for your prepared query is bad
>because the LIKE parameter is not known at
>prepare time...

Almost. My problem is that queries made with the
PQexecParams C call are automatically split into
a prepare and execute pair. So while as far as my
code's concerned everything goes over to the
server in one big wad, the same as if I'd sent it
over with a PQexec call, the server sees it in
several pieces.

The only way to fix this is to change the way
that PQexecParams is handled, which from what I
can see of the postgres code would require a
protocol change and corresponding extension of
the server back end, or a change in the way
prepared queries are executed by the server,
neither of which is a particularly simple thing
to do. (Which I didn't realize initially)
--
Dan

--------------------------------------it's like this-------------------
Dan Sugalski even samurai
dan(at)sidhe(dot)org have teddy bears and even
teddy bears get drunk

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Karl O. Pinc 2004-09-11 19:02:17 Re: Obtaining the Julian Day from a date
Previous Message Tom Lane 2004-09-11 18:54:42 Re: Obtaining the Julian Day from a date