X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id EBDB83A537A for ; Mon, 24 Jan 2005 06:46:07 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 43897-08 for ; Mon, 24 Jan 2005 06:45:56 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id 61E2F3A5361 for ; Mon, 24 Jan 2005 06:45:56 +0000 (GMT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.1/8.13.1) with ESMTP id j0O6joDl011620 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 23 Jan 2005 23:45:52 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.1/8.13.1) with ESMTP id j0O6joW3039920; Sun, 23 Jan 2005 23:45:50 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.1/8.13.1/Submit) id j0O6jns1039919; Sun, 23 Jan 2005 23:45:49 -0700 (MST) (envelope-from mfuhr) Date: Sun, 23 Jan 2005 23:45:49 -0700 From: Michael Fuhr To: mrblonde@locked.myftp.org Cc: pgsql-sql@postgresql.org Subject: Re: update from multiple rows Message-ID: <20050124064549.GA39811@winnie.fuhr.org> References: <20050122193539.GA88448@winnie.fuhr.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.003 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200501/208 X-Sequence-Number: 19996 On Sun, Jan 23, 2005 at 11:36:11AM +0000, adam etienne wrote: > In fact the computation is somewhat more complex than an average and the > data set is quite large... I did some test with view & triggers but it's > too slow.. Can you provide any more detail about the algorithm and the number of rows that you might have to insert or update? How did the test triggers work? If you used row-level triggers and if a trigger on one row updated multiple rows, then you might have been updating rows more times than necessary (once by explicit update and one or more unnecessary times by triggers on other rows). -- Michael Fuhr http://www.fuhr.org/~mfuhr/