X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 28AFDD7F9D for ; Mon, 29 Aug 2005 17:29:04 -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 87635-10 for ; Mon, 29 Aug 2005 20:29:00 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id 6600DD7F31 for ; Mon, 29 Aug 2005 17:28:58 -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 j7TKSvsS023648 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 29 Aug 2005 14:28:59 -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 j7TKSvvx099568; Mon, 29 Aug 2005 14:28:57 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.3/8.13.3/Submit) id j7TKSuEs099567; Mon, 29 Aug 2005 14:28:56 -0600 (MDT) (envelope-from mfuhr) Date: Mon, 29 Aug 2005 14:28:56 -0600 From: Michael Fuhr To: asif ali Cc: pgsql-performance@postgresql.org Subject: Re: Weird performance drop after VACUUM Message-ID: <20050829202856.GA99478@winnie.fuhr.org> References: <20050827014126.GA33637@winnie.fuhr.org> <20050829180717.74297.qmail@web35207.mail.mud.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050829180717.74297.qmail@web35207.mail.mud.yahoo.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.005 required=5 tests=[AWL=0.005] X-Spam-Level: X-Archive-Number: 200508/501 X-Sequence-Number: 14248 On Mon, Aug 29, 2005 at 11:07:17AM -0700, asif ali wrote: > The database is on the same system. > What I am doing is only "VACUUM analyze > conversion_table" > > I did the the same thing on a newly created database. > And got the same result. So after "VACUUM analyze" > performance dropped. > Please see this. Runtime changes from "7755.115" to > "14859.291" ms As has been pointed out a couple of times, you're getting a different plan after VACUUM ANALYZE because the row count estimates are more accurate. Unfortunately the more accurate estimates result in a query plan that's slower than the plan for the less accurate estimates. PostgreSQL *thinks* the plan will be faster but your results show that it isn't, so you might need to adjust some of the planner's cost constants. A asked some questions that you didn't answer, so I'll ask them again: What's your effective_cache_size setting? What's your work_mem (8.x) or sort_mem (7.x) setting? What's your random_page_cost setting? How much available RAM does the machine have? What version of PostgreSQL are you running? Various tuning guides give advice on how to set the above and other configuration variables. Here's one such guide: http://www.powerpostgresql.com/PerfList/ -- Michael Fuhr