Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id DB8581337B8D for ; Fri, 29 Oct 2010 19:03:42 -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 47171-03 for ; Fri, 29 Oct 2010 22:03:36 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 6A97D1337B78 for ; Fri, 29 Oct 2010 19:03:35 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id o9TM3PnY010075; Fri, 29 Oct 2010 18:03:25 -0400 (EDT) To: "Ozer, Pam" cc: "Josh Berkus" , pgsql-performance@postgresql.org Subject: Re: Slow Query- Bad Row Estimate In-reply-to: <216FFB77CBFAEE4B8EE4DF0A939FF1D101835A@mail-001.corp.automotive.com> References: <216FFB77CBFAEE4B8EE4DF0A939FF1D1018354@mail-001.corp.automotive.com> <4CCB3811.80900@agliodbs.com> <216FFB77CBFAEE4B8EE4DF0A939FF1D1018359@mail-001.corp.automotive.com> <4CCB42A9.2090008@agliodbs.com> <216FFB77CBFAEE4B8EE4DF0A939FF1D101835A@mail-001.corp.automotive.com> Comments: In-reply-to "Ozer, Pam" message dated "Fri, 29 Oct 2010 14:55:59 -0700" Date: Fri, 29 Oct 2010 18:03:25 -0400 Message-ID: <10074.1288389805@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201010/601 X-Sequence-Number: 41019 "Ozer, Pam" writes: > Yes. The default statistics target was at 1000. So that would be what the column was using correct? But you evidently didn't have stats. Perhaps you have autovacuum turned off? What PG version is this anyway? regards, tom lane