Skip site navigation (1) Skip section navigation (2)

Re: Avoiding bad prepared-statement plans.

From: Mark Mielke <mark(at)mark(dot)mielke(dot)cc>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Jeroen Vermeulen <jtv(at)xs4all(dot)nl>, Alex Hunsaker <badalex(at)gmail(dot)com>, 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-27 00:50:11
Message-ID: 4B886C43.3070508@mark.mielke.cc (view raw or flat)
Thread:
Lists: pgsql-hackers
On 02/26/2010 07:03 PM, Tom Lane wrote:
> Robert Haas<robertmhaas(at)gmail(dot)com>  writes:
>    
>> Basically, what I really want here is some kind of keyword or other
>> syntax that I can stick into a PL/pgsql query that requests a replan
>> on every execution.
>>      
> Wouldn't it be better if it just did the right thing automatically?
>    

Yes please. :-) Often, we are just users of the application, and we do 
not have the freedom to change it.

> The sort of heuristic I'm envisioning would essentially do "replan every
> time" for some number of executions, and give up only if it noticed that
> it wasn't getting anything better than the generic plan.  So you'd have
> a fixed maximum overhead per session when the custom plan was useless,
> and the Right Thing when it wasn't.

My other comments aside - I think generic plan + specific plan where 
specific plan continues to beat generic plan, will meet the cases that 
really annoyed me, and would make a lot of us very happy... Thanks.

Cheers,
mark


In response to

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2010-02-27 00:54:57
Subject: Re: Hot Standby query cancellation and Streaming Replication integration
Previous:From: Greg StarkDate: 2010-02-27 00:43:48
Subject: Re: Hot Standby query cancellation and Streaming Replication integration

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group