Re: Mini improvement: statement_cost_limit - Mailing list pgsql-hackers

From daveg
Subject Re: Mini improvement: statement_cost_limit
Date
Msg-id 20080803074403.GC4818@sonic.net
Whole thread Raw
In response to Re: Mini improvement: statement_cost_limit  ("Hans-Jürgen Schönig" <postgres@cybertec.at>)
Responses Re: Mini improvement: statement_cost_limit  (Simon Riggs <simon@2ndquadrant.com>)
List pgsql-hackers
On Sat, Aug 02, 2008 at 09:30:08PM +0200, Hans-Jürgen Schönig wrote:
> On Aug 2, 2008, at 8:38 PM, Tom Lane wrote:
> 
> >Andrew Dunstan <andrew@dunslane.net> writes:
> >>Hans-Jürgen Schönig wrote:
> >>>i introduced a GUC called statement_cost_limit which can be used to
> >>>error out if a statement is expected to be too expensive.
> >
> >>You clearly have far more faith in the cost estimates than I do.
> >
> >Wasn't this exact proposal discussed and rejected awhile back?
> >
> >            regards, tom lane
> >
> 
> 
> i don't remember precisely.
> i have seen it on simon's wiki page and it is something which would  
> have been useful in some cases in the past.

I think a variation on this could be very useful in development and test
environments. Suppose it raised a warning or notice if the cost was over
the limit. Then one could set a limit of a few million on the development
and test servers and developers would at least have a clue that they needed
to look at explain for that query. As it is now, one can exhort them to
run explain, but it has no effect.  Instead we later see queries killed
by a 24 hour timeout with estimated costs ranging from "until they unplug
the machine and dump it" to "until the sun turns into a red giant".

-dg

-- 
David Gould       daveg@sonic.net      510 536 1443    510 282 0869
If simplicity worked, the world would be overrun with insects.


pgsql-hackers by date:

Previous
From: Thomas Hallgren
Date:
Subject: Re: Re: [Pljava-dev] Should creating a new base type require superuser status?
Next
From: Magnus Hagander
Date:
Subject: Re: Parsing of pg_hba.conf and authentication inconsistencies