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

Re: Avoiding bad prepared-statement plans.

From: Jeroen Vermeulen <jtv(at)xs4all(dot)nl>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Avoiding bad prepared-statement plans.
Date: 2010-02-09 14:28:01
Message-ID: 4B7170F1.5020106@xs4all.nl (view raw or flat)
Thread:
Lists: pgsql-hackers
Andres Freund wrote:

>> = Actual-cost threshold =
>>
>> Also stop using the generic plan if the statement takes a long time to
>> run in practice.  Statistics may have gone bad.  It could also be a
>> one-off due to a load peak or something, but that's handled by:

> That is not that easy. It means that you have to use savepoints enclosing each 
> and every execution of a prepared statement because the query could have 
> sideeffects. Which wouldnt be terribly efficient...

This is not within an execution of the statement, but across executions. 
  So the next execution learns from the previous result.  So I'm not 
talking about aborting the ongoing execution.  Sorry for being unclear.


Jeroen

In response to

pgsql-hackers by date

Next:From: Federico Di GregorioDate: 2010-02-09 14:28:38
Subject: Re: About psycopg2 (by its author)
Previous:From: Jeroen VermeulenDate: 2010-02-09 14:25:19
Subject: Re: Avoiding bad prepared-statement plans.

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