pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: eric soroos <eric-psql@soroos.net>
To: pgsql-sql@postgresql.org
Subject: Re: Query kill
Date: Fri, 12 Jul 2002 10:22:11 -0700
Message-ID: <57020238.1185653165@[4.42.179.151]> (raw)
In-Reply-To: <200207120501.g6C51Vo14062@candle.pha.pa.us>

On Fri, 12 Jul 2002 01:01:31 -0400 (EDT) in message <200207120501.g6C51Vo14062@candle.pha.pa.us>, Bruce Momjian <pgman@candle.pha.pa.us> wrote:
> Rudi Starcevic wrote:
> > Hello,
> > 
> > If I write a query that is inefficient or in an eternal loop how
> > do I stop it without restarting the postmaster ?
> > 
> > I can see many postmaster processed appearing in the output of the 'ps' 
> > command.
> > Do I need to stop/kill them all or can I stop just the query I want ?
> 
> Just send a SIGINT to the process. That simulates a ^C, which works too
> from the client like psql.

Is there a way to deny permission for certain users to execute a query that exceeds some expected cost?

For example, I have a query builder from user input that could produce a query that ends up doing something that the query planner thinks will take 8M units of work. Generally, this is an unconstrained join between my biggest tables, a result that is neither fast nor useful.

If I could set a threshold of 1M units for the webapp user, I could trap this sort of thing before they cause quality of service issues. 

eric





view thread (7+ messages)  latest in thread

Message-ID: <57020238.1185653165@[4.42.179.151]>
Permalink:  ../57020238.1185653165@%5B4.42.179.151%5D/
Also on:    postgresql.org/message-id/57020238.1185653165@[4.42.179.151]

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: eric-psql@soroos.net
  Subject: Re: Query kill
  In-Reply-To: <57020238.1185653165@[4.42.179.151]>

* 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