Re: Avoiding bad prepared-statement plans.

From: Alex Hunsaker <badalex(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Jeroen Vermeulen <jtv(at)xs4all(dot)nl>, Greg Stark <gsstark(at)mit(dot)edu>, Bart Samwel <bart(at)samwel(dot)tk>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Avoiding bad prepared-statement plans.
Date: 2010-02-26 20:02:40
Message-ID: 34d269d41002261202n492cc8bcoefa6ec77e507fb58@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Feb 26, 2010 at 09:50, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Fri, Feb 26, 2010 at 1:29 AM, Alex Hunsaker <badalex(at)gmail(dot)com> wrote:
>> Prepared plans + exec plan (new guc/ protocol thing):
>>  Use: not quite sure
>>  Problems: slow because it would replan every time
>>  Solutions: use a prepared plan with the appropriate things not
>> parametrized...?
>>
>> [ aka we already have this, its called dont use a prepared statement ]
>
> The point is sometimes you'd like to replan every time, but not
> reparse every time.  There's no way to do that ATM.

So what you save on parse time? Maybe that's worth it. I've never
run the numbers nor have I seen them in this thread. I probably
missed em... My _hunch_ is planning will on average take
significantly longer than parse time (read in the noise of plan time).
But that's unfounded :) I can certainly imagine cases where you have
HUGE queries where the parse time too slow-- wont the plan most of the
time be an order of magnitude slower? Anyway Ill stop until I get a
chance to do _some_ kind of benchmarking, I'm really quite clueless
here.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2010-02-26 20:04:23 Re: Re: Hot Standby query cancellation and Streaming Replication integration
Previous Message Josh Berkus 2010-02-26 20:02:08 Re: Re: Hot Standby query cancellation and Streaming Replication integration