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 75383D7F31 for ; Mon, 29 Aug 2005 19:59:14 -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 25531-10 for ; Mon, 29 Aug 2005 22:59:13 +0000 (GMT) Received: from web35204.mail.mud.yahoo.com (web35204.mail.mud.yahoo.com [66.163.179.83]) by svr1.postgresql.org (Postfix) with SMTP id 52972D7F1E for ; Mon, 29 Aug 2005 19:59:09 -0300 (ADT) Received: (qmail 69967 invoked by uid 60001); 29 Aug 2005 22:59:12 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=JTicJ7aGs+Zeadh2ZMP3406znto2Jl38AgbZXtcRQgDr19CWTDZQIk7Vz/aYQsU0H6zvuFO1XJzmrIxnUw+qQJkzNhdLiSwP3kSdVjefA2vq76vPcH88TNafqoVwSN/k6TbAJLNunR2aUz0ZPKtUOQelJa0t1s+MrnJf5VGX3OY= ; Message-ID: <20050829225912.69965.qmail@web35204.mail.mud.yahoo.com> Received: from [65.218.233.130] by web35204.mail.mud.yahoo.com via HTTP; Mon, 29 Aug 2005 15:59:12 PDT Date: Mon, 29 Aug 2005 15:59:12 -0700 (PDT) From: asif ali Subject: Re: Weird performance drop after VACUUM To: Michael Fuhr Cc: pgsql-performance@postgresql.org In-Reply-To: <20050829202856.GA99478@winnie.fuhr.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.28 required=5 tests=[AWL=-0.094, DNS_FROM_RFC_ABUSE=0.374] X-Spam-Level: X-Archive-Number: 200508/503 X-Sequence-Number: 14250 Michael, The effective_cache_size, random_page_cost, work_mem were set to default. (commented). I have changed the setting of these and now the performance is better see below. "HashAggregate (cost=42573.89..42925.52 rows=20093 width=37) (actual time=5273.984..5430.733 rows=55717 loops=1)" " -> Seq Scan on keyword_conversion_table c (cost=0.00..27336.12 rows=870730 width=37) (actual time=0.052..1405.576 rows=885493 loops=1)" " Filter: ((conversion_date >= '2005-06-07'::date) AND (conversion_date <= '2005-08-17'::date))" "Total runtime: 5463.764 ms" Thanks a lot --- Michael Fuhr wrote: > 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 > > ---------------------------(end of > broadcast)--------------------------- > TIP 3: Have you checked our extensive FAQ? > > http://www.postgresql.org/docs/faq > ____________________________________________________ Start your day with Yahoo! - make it your home page http://www.yahoo.com/r/hs