Re: Automatic function replanning - Mailing list pgsql-hackers

From Chris Browne
Subject Re: Automatic function replanning
Date
Msg-id 60hd97mb3c.fsf@dba2.int.libertyrms.com
Whole thread Raw
In response to Re: Automatic function replanning  ("Jim C. Nasby" <jnasby@pervasive.com>)
Responses Re: Automatic function replanning
List pgsql-hackers
Lukas Smith <mls@pooteeweet.org> writes:
> Bruce Momjian wrote:
>
>>     * Flush cached query plans when the dependent objects change,
>>       when the cardinality of parameters changes dramatically, or
>>       when new ANALYZE statistics are available
>
> Wouldn't it also make sense to flush a cached query plan when after
> execution it is determined that one or more assumptions that the
> cached query plan was based on was found to be off? Like the query
> plan was based on the assumption that a particular table would only
> return a hand full of rows, but in reality it returned a few
> thousand.

There is some merit to that.

I could also see it being sensible to flush a cached plan any time the
query took more than some [arbitrary/GUC-chosen] interval.

Supposing it took 20s to execute the query, it would surely seem
surprising for re-evaluating the plan to be expected to make up a
material proportion of the cost of the *next* invocation.

If we flush every plan that took >10s to evaluate, that offers the
possibility for it to be done better next time...
-- 
output = reverse("gro.mca" "@" "enworbbc")
http://www.ntlug.org/~cbbrowne/internet.html
Points  are awarded for   getting   the last   word in.   Drawing  the
conversation out so long  that the original  message disappears due to
being indented off the right hand edge of the screen is  one way to do
this.  Another is to imply that  anyone replying further is a hopeless
cretin and is wasting everyone's valuable time.
-- from the Symbolics Guidelines for Sending Mail


pgsql-hackers by date:

Previous
From: Lukas Smith
Date:
Subject: Re: Automatic function replanning
Next
From: Bruce Momjian
Date:
Subject: Re: Automatic function replanning