X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 1225F52970 for ; Wed, 29 Jun 2005 09:50:42 -0300 (ADT) 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 50050-05 for ; Wed, 29 Jun 2005 12:50:36 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id AE28252956 for ; Wed, 29 Jun 2005 09:50:34 -0300 (ADT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id j5TCoNAl086665 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 29 Jun 2005 06:50:26 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.3/8.13.3) with ESMTP id j5TCoNR0031317; Wed, 29 Jun 2005 06:50:23 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.3/8.13.3/Submit) id j5TCoMqs031316; Wed, 29 Jun 2005 06:50:22 -0600 (MDT) (envelope-from mfuhr) Date: Wed, 29 Jun 2005 06:50:22 -0600 From: Michael Fuhr To: "Chun Yit(Chronos)" Cc: pgsql-performance@postgresql.org Subject: Re: Postgresql7.4.5 running slow on plpgsql function Message-ID: <20050629125022.GA31236@winnie.fuhr.org> Reply-To: pgsql-performance@postgresql.org References: <000601c577d9$e2658600$a279640a@Beh> <20050628062620.GB18635@winnie.fuhr.org> <003301c57c63$2bbcfee0$a279640a@Beh> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <003301c57c63$2bbcfee0$a279640a@Beh> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.005 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200506/587 X-Sequence-Number: 13224 [Please copy the mailing list on replies so others can contribute to and learn from the discussion.] On Wed, Jun 29, 2005 at 12:29:42PM +0800, Chun Yit(Chronos) wrote: > > Yes, the function will delete records from the temporary table every time > on each call. > if leaving a lot of dead tuples, then how can we solve it? If the function deletes all records from the temporary table then you could use TRUNCATE instead of DELETE. Otherwise you could VACUUM the table between calls to the function (you can't run VACUUM inside a function). -- Michael Fuhr http://www.fuhr.org/~mfuhr/