Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 2756B1337CFF for ; Wed, 6 Apr 2011 15:23:32 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 88566-07-3 for ; Wed, 6 Apr 2011 18:23:14 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.gransy.com (mail.gransy.com [82.208.29.194]) by mail.postgresql.org (Postfix) with ESMTP id D1CA21337E41 for ; Wed, 6 Apr 2011 15:13:21 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by mail.gransy.com (Postfix) with ESMTP id B87FE2E5A0B3 for ; Wed, 6 Apr 2011 20:13:19 +0200 (CEST) Received: from mail.gransy.com ([127.0.0.1]) by localhost (nathalia.gransy.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id L5UsPAHRf0o2 for ; Wed, 6 Apr 2011 20:13:19 +0200 (CEST) Received: from [192.168.1.7] (ip-94-112-0-189.net.upcbroadband.cz [94.112.0.189]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.gransy.com (Postfix) with ESMTPSA id A327D2E5A0AB for ; Wed, 6 Apr 2011 20:13:19 +0200 (CEST) Message-ID: <4D9CAD3F.8040606@fuzzy.cz> Date: Wed, 06 Apr 2011 20:13:19 +0200 From: Tomas Vondra User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101219 Lightning/1.0b3pre Thunderbird/3.1.7 MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: help speeding up a query in postgres 8.4.5 References: <4D9B6CBA.2050609@nasa.gov> <4D9C6BA6.4070305@nasa.gov> <4D9C4182020000250003C3AB@gw.wicourts.gov> In-Reply-To: <4D9C4182020000250003C3AB@gw.wicourts.gov> X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201104/49 X-Sequence-Number: 43111 Dne 6.4.2011 17:33, Kevin Grittner napsal(a): > "Maria L. Wilson" wrote: > >> Autovacuum is not running - but regular vacuums are being done >> twice daily. > > Is the ANALYZE keyword used on those VACUUM runs? What version of > PostgreSQL is this. If it's enough to need fsm settings, do you run > with the VERBOSE option and check the end of the output to make sure > they are set high enough? Why do you think the problem is related to stale stats? It seems to me fairly accurate - see the explain analyze in the first post). All the nodes are less than 1% off (which is great), except for the last hash join that returns 336949 rows instead of 924675 expected rows. Maybe I'm missing something, but the stats seem to be quite accurate and there is just very little dead tuples I guess. regards Tomas