Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 08A766322EA for ; Thu, 25 Feb 2010 19:46:45 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 41987-09 for ; Thu, 25 Feb 2010 23:46:28 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from momjian.us (momjian.us [70.90.9.53]) by mail.postgresql.org (Postfix) with ESMTP id 3E119633515 for ; Thu, 25 Feb 2010 19:46:34 -0400 (AST) Received: (from bruce@localhost) by momjian.us (8.11.6/8.11.6) id o1PNkXG07892; Thu, 25 Feb 2010 18:46:33 -0500 (EST) From: Bruce Momjian Message-Id: <201002252346.o1PNkXG07892@momjian.us> Subject: Re: No hash join across partitioned tables? In-Reply-To: <12401.1240183911@sss.pgh.pa.us> To: Tom Lane Date: Thu, 25 Feb 2010 18:46:33 -0500 (EST) CC: Kris Jurka , pgsql-performance@postgresql.org X-Mailer: ELM [version 2.4ME+ PL124 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="US-ASCII" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.3 tagged_above=-10 required=5 tests=AWL=0.143, BAYES_00=-2.599, SUBJECT_FUZZY_TION=0.156 X-Spam-Level: X-Archive-Number: 201002/362 X-Sequence-Number: 37783 Did this get addressed? --------------------------------------------------------------------------- Tom Lane wrote: > Kris Jurka writes: > > The real problem is getting reasonable stats to pass through the partition > > Append step, so it can make a reasonable estimate of the join output size. > > I dug around a bit and concluded that the lack of stats for the Append > relation is indeed the main problem. It's not so much the bad join size > estimate (although that could hurt for cases where you need to join this > result to another table). Rather, it's that the planner is deliberately > biased against picking hash joins in the absence of stats for the inner > relation. Per the comments for estimate_hash_bucketsize: > > * If no statistics are available, use a default estimate of 0.1. This will > * discourage use of a hash rather strongly if the inner relation is large, > * which is what we want. We do not want to hash unless we know that the > * inner rel is well-dispersed (or the alternatives seem much worse). > > While we could back off the default a bit here, I think it'd be better > to fix it by not punting on the stats-for-append-relations problem. > That doesn't seem like material for 8.4 at this point, though. > > 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 -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com PG East: http://www.enterprisedb.com/community/nav-pg-east-2010.do + If your life is a hard drive, Christ can be your backup. +