Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 56CA59FB263 for ; Sun, 11 Feb 2007 14:02:18 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-new, port 10024) with ESMTP id 54481-07 for ; Sun, 11 Feb 2007 14:02:13 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from sumo.dreamhost.com (sumo.dreamhost.com [66.33.216.29]) by postgresql.org (Postfix) with ESMTP id 4642D9FB320 for ; Sun, 11 Feb 2007 14:02:13 -0400 (AST) Received: from spunkymail-a5.g.dreamhost.com (sd-green-bigip-177.dreamhost.com [208.97.132.177]) by sumo.dreamhost.com (Postfix) with ESMTP id 2ACD017FA88 for ; Sun, 11 Feb 2007 10:02:12 -0800 (PST) Received: from [192.168.1.238] (adsl-75-36-67-4.dsl.irvnca.sbcglobal.net [75.36.67.4]) by spunkymail-a5.g.dreamhost.com (Postfix) with ESMTP id 00D3914D6AA; Sun, 11 Feb 2007 10:02:07 -0800 (PST) Message-ID: <45CF5A19.1010101@araisoft.com> Date: Sun, 11 Feb 2007 10:02:01 -0800 From: Benjamin Arai User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) MIME-Version: 1.0 To: Magnus Hagander Cc: Adam Rich , pgsql-general@postgresql.org Subject: Re: Priorities for users or queries? References: <000001c74da2$a9a4a990$6400a8c0@dualcore> <45CEE33B.8020303@hagander.net> In-Reply-To: <45CEE33B.8020303@hagander.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.16 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200702/515 X-Sequence-Number: 109005 Hi Magnus, Think this can be avoided as long the the queries executed on the lower priority process never lock anything important. In my case, I would alway be doing inserts with the lower priority process, so inversion should never occur. On the other hand if some lock occur somewhere else specific to Postgres then there may be an issue. Are there any other tables locked by the the Postgres process other than those locks explicitly set by the query? Benjamin Magnus Hagander wrote: > 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 >> > >