Received: from localhost (pluto.hub.org [200.46.204.4]) by postgresql.org (Postfix) with ESMTP id CB3B89FA3C0 for ; Thu, 2 Nov 2006 11:20:50 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.4]) (amavisd-new, port 10024) with ESMTP id 65436-01 for ; Thu, 2 Nov 2006 11:20:41 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from exchange.g2switchworks.com (mail.g2switchworks.com [63.87.162.25]) by postgresql.org (Postfix) with ESMTP id 9E0C69F9ECF for ; Thu, 2 Nov 2006 11:20:45 -0400 (AST) Received: from 10.10.1.37 ([10.10.1.37]) by exchange.g2switchworks.com ([10.10.1.2]) with Microsoft Exchange Server HTTP-DAV ; Thu, 2 Nov 2006 15:20:36 +0000 Received: from state.g2switchworks.com by mail.g2switchworks.com; 02 Nov 2006 09:20:36 -0600 Subject: Re: Setting "nice" values From: Scott Marlowe To: Madison Kelly Cc: pgsql-performance@postgresql.org In-Reply-To: <454A0B69.9070000@alteeve.com> References: <454A0B69.9070000@alteeve.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1162480836.28047.20.camel@state.g2switchworks.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Thu, 02 Nov 2006 09:20:36 -0600 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/26 X-Sequence-Number: 21796 On Thu, 2006-11-02 at 09:14, Madison Kelly wrote: > Hi all, > > I've got a script (perl, in case it matters) that I need to run once > a month to prepare statements. This script queries and updates the > database a *lot*. I am not concerned with the performance of the SQL > calls so much as I am about the impact it has on the server's load. > > Is there a way to limit queries speed (ie: set a low 'nice' value on > a query)? This might be an odd question, or I could be asking the > question the wrong way, but hopefully you the idea. :) While you can safely set the priority lower on the calling perl script, setting db backend priorities lower can result in problems caused by "priority inversion" Look up that phrase on the pgsql admin, perform, general, or hackers lists for an explanation, or go here: http://en.wikipedia.org/wiki/Priority_inversion I have a simple script that grabs raw data from an oracle db and shoves it into a postgresql database for reporting purposes. Every 100 rows I put into postgresql, I usleep 10 or so and the load caused by that script on both systems is minimal. You might try something like that.