X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 4AE3DD1DF95 for ; Thu, 15 Jan 2004 16:11:14 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 08861-01 for ; Thu, 15 Jan 2004 12:10:43 -0400 (AST) Received: from anchor-post-33.mail.demon.net (anchor-post-33.mail.demon.net [194.217.242.91]) by svr1.postgresql.org (Postfix) with ESMTP id 61DEED1DAA6 for ; Thu, 15 Jan 2004 12:10:43 -0400 (AST) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-33.mail.demon.net with esmtp (Exim 3.35 #1) id 1AhA4w-000LtW-0X; Thu, 15 Jan 2004 16:10:42 +0000 Received: by mainbox.archonet.com (Postfix, from userid 529) id 9260516FCC; Thu, 15 Jan 2004 16:10:41 +0000 (GMT) Received: from client17.archonet.com (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id E3A2516FCA; Thu, 15 Jan 2004 16:10:39 +0000 (GMT) From: Richard Huxton To: pginfo , "pgsql-performance@postgresql.org" Subject: Re: Trigger question Date: Thu, 15 Jan 2004 16:10:38 +0000 User-Agent: KMail/1.5 References: <400691EA.96598C34@t1.unisoftbg.com> In-Reply-To: <400691EA.96598C34@t1.unisoftbg.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200401151610.38270.dev@archonet.com> X-Bogosity: No, tests=bogofilter, spamicity=0.000000, version=0.15.3 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/156 X-Sequence-Number: 5331 On Thursday 15 January 2004 13:13, pginfo wrote: > Hi, > > I am using pg 7.4.1 and have created a trigger over table with 3 M rows. > If I start masive update on this table, pg executes this trigger on > every row and dramaticaly slows the system. > Exists in pg any way to define the trigger execution only if I have > changes on some fields? Not at the moment (and I don't know of any plans for it). > For example I am able to declare this in oracle. > My trigger is writen in pgSQL. Hmm - I can only think of two things you can try: 1. check for the change first thing you do and exit if not there 2. do the same, but write the trigger function in 'C' -- Richard Huxton Archonet Ltd