Re: Query kill

From: eric soroos <eric-psql(at)soroos(dot)net>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Query kill
Date: 2002-07-12 17:22:11
Message-ID: 57020238.1185653165@[4.42.179.151]
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Fri, 12 Jul 2002 01:01:31 -0400 (EDT) in message <200207120501(dot)g6C51Vo14062(at)candle(dot)pha(dot)pa(dot)us>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Jan Wieck 2002-07-12 17:53:28 Re: Query kill
Previous Message Dmitry Tkach 2002-07-12 16:17:18 It is a bug in pred_test()! (Was: [SQL] Please, HELP! Why is the query plan so wrong???)