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

From Gregory Stark
Subject Re: Mini improvement: statement_cost_limit
Date
Msg-id 8763qh6r92.fsf@oxford.xeocode.com
Whole thread Raw
In response to Re: Mini improvement: statement_cost_limit  (Josh Berkus <josh@agliodbs.com>)
Responses Re: Mini improvement: statement_cost_limit  (Josh Berkus <josh@agliodbs.com>)
List pgsql-hackers
"Josh Berkus" <josh@agliodbs.com> writes:

> Tom,
>
>> Wasn't this exact proposal discussed and rejected awhile back?
>
> We rejected Greenplum's much more invasive resource manager, because it 
> created a large performance penalty on small queries whether or not it was 
> turned on.  However, I don't remember any rejection of an idea as simple 
> as a cost limit rejection.

The idea's certainly come up before. It probably received the usual
non-committal cold shoulder rather than an outright "rejection".

> This would, IMHO, be very useful for production instances of PostgreSQL.  
> The penalty for mis-rejection of a poorly costed query is much lower than 
> the penalty for having a bad query eat all your CPU.

Well that's going to depend on the application.... But I suppose there's
nothing wrong with having options which aren't always a good idea to use. The
real question I guess is whether there's ever a situation where it would be a
good idea to use this. I'm not 100% sure.

What I would probably use myself is an option to print a warning before
starting the query. That would be handy for interactive sessions so you would
be able to hit C-c instead of waiting for several minutes and then wondering
whether you got the query wrong.

I wonder if it would be useful to have a flag on some GUC options to make them
not globally settable. That is, for example, you could set enable_seqscan in
an individual session but not in postgres.conf. Or perhaps again just print a
warning that it's not recommended as a global configuration.

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com Ask me about EnterpriseDB's Slony Replication
support!


pgsql-hackers by date:

Previous
From: Zdenek Kotala
Date:
Subject: Re: unnecessary code in_bt_split
Next
From: Magnus Hagander
Date:
Subject: Re: Location for pgstat.stat