Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id DC4639FB1CB for ; Sun, 11 Feb 2007 05:34:56 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-new, port 10024) with ESMTP id 26027-08 for ; Sun, 11 Feb 2007 05:34:50 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from svr2.hagander.net (svr2.hagander.net [88.198.128.226]) by postgresql.org (Postfix) with ESMTP id C955B9FA3E9 for ; Sun, 11 Feb 2007 05:34:52 -0400 (AST) Received: from [192.168.199.196] (c213-100-160-41.swipnet.se [213.100.160.41]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by svr2.hagander.net (Postfix) with ESMTP id 3C0A9DCC48F; Sun, 11 Feb 2007 10:34:51 +0100 (CET) Message-ID: <45CEE33B.8020303@hagander.net> Date: Sun, 11 Feb 2007 10:34:51 +0100 From: Magnus Hagander User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 To: Adam Rich CC: 'Benjamin Arai' , pgsql-general@postgresql.org Subject: Re: Priorities for users or queries? References: <000001c74da2$a9a4a990$6400a8c0@dualcore> In-Reply-To: <000001c74da2$a9a4a990$6400a8c0@dualcore> X-Enigmail-Version: 0.94.2.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.219 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200702/507 X-Sequence-Number: 108997 Most likely, you do not want to do this. You *can* do it, but you are quite likely to suffer from priority inversion (http://en.wikipedia.org/wiki/Priority_inversion) //Magnus Adam Rich wrote: > There is a function pg_backend_pid() that will return the PID for > the current session. You could call this from your updating app > to get a pid to feed to the NICE command. > > > -----Original Message----- > From: pgsql-general-owner@postgresql.org > [mailto:pgsql-general-owner@postgresql.org] On Behalf Of Benjamin Arai > Sent: Saturday, February 10, 2007 6:56 PM > To: pgsql-general@postgresql.org; pgsql-admin@postgresql.org > Subject: [GENERAL] Priorities for users or queries? > > > Hi, > > Is there a way to give priorities to queries or users? Something > similar to NICE in Linux. My goal is to give the updating (backend) > application a very low priority and give the web application a high > priority to avoid disturbing the user experience. > > Thanks in advance! > > Benjamin > > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Have you searched our list archives? > > http://archives.postgresql.org/ > > > ---------------------------(end of broadcast)--------------------------- > TIP 3: Have you checked our extensive FAQ? > > http://www.postgresql.org/docs/faq