pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <pgman@candle.pha.pa.us>
To: Shaun Thomas <sthomas@townnews.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Cost limit.
Date: Fri, 18 May 2001 11:41:40 -0400 (EDT)
Message-ID: <200105181541.f4IFfeO25525@candle.pha.pa.us> (raw)
In-Reply-To: <Pine.LNX.4.30.0105171547590.6309-100000@hamster.lee.net>

That is on the TODO list:

        * Add SET or BEGIN timeout parameter to cancel query if waiting
	  too long

> Hey all,
> 
> I can't seem to find it in the docs, so I'll ask here.  Is there a
> way in postgres to impose a limit on query costs?  I'd noticed some
> horribly disfigured queries hitting my poor database from one of our
> developers, and corrected him.  But many of our users are not so
> easily contacted.  What I want to know is if there's a configuration
> parameter or source patch that will allow me to disallow a query
> execution if the pre-execution cost estimation is too high.
> 
> The reason I'm asking?  Our developer accidentally created a cross
> product that resulted in an explain-plan cost of approximately
> 1.3 trillion.  Before we tracked the problem down, the application
> causing the query would halt for an answer indefinitely.  Even after
> stopping the application, postgres would grind on.  The load on the
> machine was hovering around 20, with 5 postgres threads sharing
> the blame.  I'd hate for any user to have the power to cripple
> our database server by simply writing a bad query.
> 
> Should I contact the developers list on this and request a patch?
> Could someone direct me to the correct piece of source code to...
> er... enhance?
> 
> Thanks in advance.
> 
> -- 
> +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+
> | Shaun M. Thomas                INN Database Programmer              |
> | Phone: (309) 743-0812          Fax  : (309) 743-0830                |
> | Email: sthomas@townnews.com    AIM  : trifthen                      |
> | Web  : hamster.lee.net                                              |
> |                                                                     |
> |     "Most of our lives are about proving something, either to       |
> |      ourselves or to someone else."                                 |
> |                                           -- Anonymous              |
> +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
> 
> http://www.postgresql.org/users-lounge/docs/faq.html
> 

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026



view thread (8+ messages)  latest in thread

Message-ID: <200105181541.f4IFfeO25525@candle.pha.pa.us>
Permalink:  ../200105181541.f4IFfeO25525@candle.pha.pa.us/
Also on:    postgresql.org/message-id/200105181541.f4IFfeO25525@candle.pha.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: pgman@candle.pha.pa.us, sthomas@townnews.com
  Subject: Re: Cost limit.
  In-Reply-To: <200105181541.f4IFfeO25525@candle.pha.pa.us>
  References: <Pine.LNX.4.30.0105171547590.6309-100000@hamster.lee.net> <200105181541.f4IFfeO25525@candle.pha.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox