Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 512996506BB for ; Mon, 14 Jul 2008 15:08:30 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 54952-01-4 for ; Mon, 14 Jul 2008 15:08:21 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from yw-out-2324.google.com (yw-out-2324.google.com [74.125.46.31]) by postgresql.org (Postfix) with ESMTP id 8DA2A6506AB for ; Mon, 14 Jul 2008 15:08:19 -0300 (ADT) Received: by yw-out-2324.google.com with SMTP id 3so2244064ywj.73 for ; Mon, 14 Jul 2008 11:08:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=YMmlYbH5jx4/PdXuh8H2FXe1O0T3dvuhmFOBL/KbG5A=; b=pFoStxLMjlANABgv8bmuT96wI3JBjLpvw1N2lqjH/LYTiUByB+4vfUYS+PTKdeNkJ7 IIy0kP84E/gPNGQcLIoYVfZmUv6yAilhdgNccQZdppprfxnrjgBf/6DNiq2Yg9IK1eBM lM26q7ssCfkyQx2cKyNJjy8f+3Y/oE1oWB3Wk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=Maez6KvW3N/UTbZ2ayY4ZGBNgGe+R8ZJ9Zxk7xFiSLNljfqpxsyYIp0tOnTCqPKyNm CWnEiwkCuSV2yo777seVepSZb7YhPHfaGeKmMk8+kfnO+mCcS6okiih8pHyKDFyrFaJz 1FDuvFiYS6QuXmSe+QZnsauHzQdJj27jdCpoU= Received: by 10.114.56.4 with SMTP id e4mr18006967waa.0.1216058893206; Mon, 14 Jul 2008 11:08:13 -0700 (PDT) Received: by 10.114.130.17 with HTTP; Mon, 14 Jul 2008 11:08:13 -0700 (PDT) Message-ID: Date: Mon, 14 Jul 2008 12:08:13 -0600 From: "Scott Marlowe" To: Ramasubramanian Subject: Re: Trigger is taking time to fire Cc: pgsql-performance@postgresql.org In-Reply-To: <011701c8e576$c4bcfa80$324610ac@ramasubramanian> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <011701c8e576$c4bcfa80$324610ac@ramasubramanian> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200807/128 X-Sequence-Number: 30728 On Sun, Jul 13, 2008 at 11:59 PM, Ramasubramanian wrote: > > Hi All, > I am having a trigger in table, If i update the the table manually it is > not taking time(say 200ms per row), But if i update the table through > procedure the trigger is taking time to fire(say 7 to 10 seconds per row). > > How can i make the trigger to fire immediately ? I'm thinking the user defined function is using a cached query plan. Try using execute to see if it runs faster that way.