Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 696D01337B71 for ; Fri, 29 Oct 2010 18:50:16 -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 32072-10 for ; Fri, 29 Oct 2010 21:50:09 +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 ABAA21336705 for ; Fri, 29 Oct 2010 18:50:08 -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 o9TLo79i009824; Fri, 29 Oct 2010 17:50:07 -0400 (EDT) To: "Ozer, Pam" cc: pgsql-performance@postgresql.org Subject: Re: Slow Query- Bad Row Estimate In-reply-to: <216FFB77CBFAEE4B8EE4DF0A939FF1D1018358@mail-001.corp.automotive.com> References: <216FFB77CBFAEE4B8EE4DF0A939FF1D1018354@mail-001.corp.automotive.com> <9343.1288387050@sss.pgh.pa.us> <216FFB77CBFAEE4B8EE4DF0A939FF1D1018358@mail-001.corp.automotive.com> Comments: In-reply-to "Ozer, Pam" message dated "Fri, 29 Oct 2010 14:45:52 -0700" Date: Fri, 29 Oct 2010 17:50:07 -0400 Message-ID: <9823.1288389007@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/598 X-Sequence-Number: 41016 "Ozer, Pam" writes: > I am not sure what you mean by reformulate the data representation. Do > you mean do I have to join on all three columns? No, I was wondering if you could change things so that you join on just one column, instead of two that each tell part of the truth. BTW, did you check your current statistics target? If it's small then raising it might possibly fix the problem by itself. regards, tom lane