Re: Avoiding bad prepared-statement plans. - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Avoiding bad prepared-statement plans.
Date
Msg-id 2060.1267210762@sss.pgh.pa.us
Whole thread Raw
In response to Re: Avoiding bad prepared-statement plans.  (Mark Mielke <mark@mark.mielke.cc>)
Responses Re: Avoiding bad prepared-statement plans.
Re: Avoiding bad prepared-statement plans.
List pgsql-hackers
Mark Mielke <mark@mark.mielke.cc> writes:
> Just to point out that I agree, and as per my original post, I think the 
> only time prepared statements should be re-planned for the statistics 
> case, is after 'analyze' has run. That sounds like a quicker solution, 
> and a much smaller gain. After 'analyze' of an object, invalidate all 
> cached plans for prepared statements that rely on that object and 
> require a re-plan.

Please note that that has been happening since 8.3, which is probably
why you haven't detected a problem.

> ... It's walking around the problem 
> that the idea of a generic plan is just wrong. The only time a generic 
> plan is right, is when the specific plan would result in the same.

I think that's a significant overstatement.  There are a large number
of cases where a custom plan isn't worth it, even if it doesn't generate
exactly the same plan.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Gokulakannan Somasundaram
Date:
Subject: Re: A thought on Index Organized Tables
Next
From: Bruce Momjian
Date:
Subject: Re: Re: Hot Standby query cancellation and Streaming Replication integration