Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1ThBqL-0004Pd-OP for pgsql-performance@arkaria.postgresql.org; Sat, 08 Dec 2012 04:16:49 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1ThBqL-0002zQ-9E for pgsql-performance@arkaria.postgresql.org; Sat, 08 Dec 2012 04:16:49 +0000 Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1ThBqK-0002yt-Ic for pgsql-performance@postgresql.org; Sat, 08 Dec 2012 04:16:48 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1ThBqJ-0007nR-29 for pgsql-performance@postgresql.org; Sat, 08 Dec 2012 04:16:48 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id qB84GjCm002905; Fri, 7 Dec 2012 23:16:45 -0500 (EST) From: Tom Lane To: Jeff Janes cc: Guillaume Smet , pgsql-performance@postgresql.org Subject: Re: Any idea on how to improve the statistics estimates for this plan? In-reply-to: References: Comments: In-reply-to Jeff Janes message dated "Fri, 07 Dec 2012 18:32:15 -0800" Date: Fri, 07 Dec 2012 23:16:45 -0500 Message-ID: <2904.1354940205@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org Jeff Janes writes: > The trivial answer to "why" is that it thinks that the vast majority > of the 33914 rows from the hash join will find no partners in r, but > in fact each has about 10 partner in r. Why does it think that? I'm wondering if maybe the vast majority of the rows indeed have no join partners, but there are a small number with a large number of partners. The statistics might miss these, if so. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance