Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id C4C296349FC for ; Thu, 16 Apr 2009 22:02:07 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 73142-07 for ; Thu, 16 Apr 2009 22:02:06 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from leary.csoft.net (leary.csoft.net [205.205.214.5]) by mail.postgresql.org (Postfix) with ESMTP id 73BDC634574 for ; Thu, 16 Apr 2009 22:02:06 -0300 (ADT) Received: by leary.csoft.net (Postfix, from userid 1112) id 58B31AADD; Thu, 16 Apr 2009 21:02:04 -0400 (EDT) Date: Thu, 16 Apr 2009 21:02:04 -0400 (EDT) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Tom Lane cc: pgsql-performance@postgresql.org Subject: Re: No hash join across partitioned tables? In-Reply-To: Message-ID: References: <7163.1239923531@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.41 tagged_above=0 required=5 tests=SUBJECT_FUZZY_TION=0.41 X-Spam-Level: X-Archive-Number: 200904/283 X-Sequence-Number: 33650 On Thu, 16 Apr 2009, Kris Jurka wrote: > Perhaps the cost estimates for the real data are so high because of this > bogus row count that the fudge factor to disable mergejoin isn't enough? > Indeed, I get these cost estimates on 8.4b1 with an increased disable_cost value: nestloop: 11171206.18 merge: 58377401.39 hash: 116763544.76 So the default disable_cost isn't enough to push it to use the hash join plan and goes back to nestloop. Since disable_cost hasn't been touched since January 2000, perhaps it's time to bump that up to match today's hardware and problem sizes? This isn't even a particularly big problem, it's joing 18M rows against 30k. 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. Kris Jurka