X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id BBEC4D1B519 for ; Tue, 9 Sep 2003 14:41:20 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 16919-03 for ; Tue, 9 Sep 2003 11:40:51 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id D8A6ED1B4EC for ; Tue, 9 Sep 2003 11:40:46 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h89EemAn021263; Tue, 9 Sep 2003 10:40:48 -0400 (EDT) To: "Mindaugas Riauba" Cc: pgsql-performance@postgresql.org Subject: Re: Need advice about triggers In-reply-to: <00dc01c376d6$f9f99c30$f20214ac@bite.lt> References: <00be01c376cf$91510620$f20214ac@bite.lt> <200309091414.23458.dev@archonet.com> <00dc01c376d6$f9f99c30$f20214ac@bite.lt> Comments: In-reply-to "Mindaugas Riauba" message dated "Tue, 09 Sep 2003 16:33:32 +0300" Date: Tue, 09 Sep 2003 10:40:48 -0400 Message-ID: <21262.1063118448@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/152 X-Sequence-Number: 3518 "Mindaugas Riauba" writes: >> Well, try it without the trigger. If performance improves markedly, it >> might be worth rewriting in C. > Nope. Execution time is practically the same without trigger. >> If not, you're probably saturating the disk I/O - > Bottleneck in this case is CPU. postmaster process uses almost 100% of > CPU. That seems very odd. Updates should be I/O intensive, not CPU intensive. I wouldn't have been surprised to hear of a plpgsql trigger consuming lots of CPU, but without it, I'm not sure where the time is going. Can you show us an EXPLAIN ANALYZE result for a typical update command? regards, tom lane