Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id A193C2E3DD4 for ; Wed, 9 Jan 2008 01:27:55 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 82164-06-5 for ; Wed, 9 Jan 2008 01:27:45 -0400 (AST) Received: from lists.commandprompt.com (host-159.commandprompt.net [207.173.203.159]) by postgresql.org (Postfix) with ESMTP id C7AAE2E3CF3 for ; Wed, 9 Jan 2008 01:06:53 -0400 (AST) Received: from perhan.alvh.no-ip.org (200-126-101-79.bk7-dsl.surnet.cl [200.126.101.79]) (authenticated bits=0) by lists.commandprompt.com (8.13.8/8.13.8) with ESMTP id m0956qKn013572 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 8 Jan 2008 21:06:55 -0800 Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 9594F47B9B; Wed, 9 Jan 2008 02:06:44 -0300 (CLST) Date: Wed, 9 Jan 2008 02:06:44 -0300 From: Alvaro Herrera To: Anoo Sivadasan Pillai Cc: pgsql-performance@postgresql.org Subject: Re: After Vacuum Analyse - Procedure performance not improved - Innner select is faster Message-ID: <20080109050644.GF20913@alvh.no-ip.org> References: <772CDA49C515244FA14E34443F62E56403AFC90C@EX-INDIA1.internal.rmplc.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <772CDA49C515244FA14E34443F62E56403AFC90C@EX-INDIA1.internal.rmplc.net> User-Agent: Mutt/1.5.17 (2007-11-01) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0 (lists.commandprompt.com [207.173.203.159]); Tue, 08 Jan 2008 21:06:56 -0800 (PST) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200801/34 X-Sequence-Number: 28273 Anoo Sivadasan Pillai wrote: > Why the procedure is not getting the performance advantage of Vacuum > analyse? Plan caching by the function, probably. Try disconnecting the session and reconnecting to prove the hypothesis. If it is a recurring problem for you, you could put the SELECT under EXECUTE in the function. But most likely this is just a one-time problem. -- Alvaro Herrera http://www.CommandPrompt.com/ PostgreSQL Replication, Consulting, Custom Development, 24x7 support