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 4C2AF8B9CD1 for ; Sun, 6 Feb 2005 16:04:44 +0000 (GMT) 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 28998-09 for ; Sun, 6 Feb 2005 16:04:30 +0000 (GMT) Received: from mailout09.sul.t-online.com (mailout09.sul.t-online.com [194.25.134.84]) by svr1.postgresql.org (Postfix) with ESMTP id 6FCB68B9E2E for ; Sun, 6 Feb 2005 16:04:29 +0000 (GMT) Received: from fwd08.aul.t-online.de by mailout09.sul.t-online.com with smtp id 1CxotW-0004nf-05; Sun, 06 Feb 2005 17:04:18 +0100 Received: from [192.168.0.70] (bKcSHaZVoexvEPeq-IFG2y0ErodEif9vosxSFUQ0EFnHaFBA4awrwH@[217.86.175.49]) by fwd08.sul.t-online.com with esmtp id 1CxotK-18wtN20; Sun, 6 Feb 2005 17:04:06 +0100 Message-ID: <42063FF5.9040707@aeccom.com> Date: Sun, 06 Feb 2005 17:04:05 +0100 From: Dirk.Lutzebaeck@t-online.de (Dirk Lutzebaeck) Reply-To: lutzeb@aeccom.com User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: John A Meinel Cc: Greg Stark , pgsql-performance@postgresql.org, tgl@sss.pgh.pa.us Subject: Re: query produces 1 GB temp file References: <20050205182117.0125074@mail2.aeccom.com> <87y8e2kb8j.fsf@stark.xeocode.com> <42061B35.6000306@aeccom.com> <4206356C.9060308@arbash-meinel.com> In-Reply-To: <4206356C.9060308@arbash-meinel.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-ID: bKcSHaZVoexvEPeq-IFG2y0ErodEif9vosxSFUQ0EFnHaFBA4awrwH X-TOI-MSGID: 82ed85ff-db8a-497e-a6b9-8c2a522036b2 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200502/129 X-Sequence-Number: 10458 John, I'm doing VACUUM ANALYZE once a night. Before the tests I did VACUUM and then ANALYZE. Dirk John A Meinel wrote: > Dirk Lutzebaeck wrote: > >> Greg, >> >> Thanks for your analysis. But I dont get any better after bumping >> STATISTICS target from 10 to 200. >> explain analyze shows that the optimizer is still way off estimating >> the rows. Is this normal? It still produces a 1 GB temp file. >> I simplified the query a bit, now only two tables are involved (bi, >> df). I also vacuumed. > > > > Are you just doing VACUUM? Or are you doing VACUUM ANALYZE? You might > also try VACUUM ANALYZE FULL (in the case that you have too many dead > tuples in the table). > > VACUUM cleans up, but doesn't adjust any planner statistics without > ANALYZE. > > John > =:-> >