Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VbDu5-00058s-2R for pgsql-performance@arkaria.postgresql.org; Tue, 29 Oct 2013 18:20:33 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VbDu4-0000eU-6N for pgsql-performance@arkaria.postgresql.org; Tue, 29 Oct 2013 18:20:32 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VbDu3-0000eN-1e for pgsql-performance@postgresql.org; Tue, 29 Oct 2013 18:20:31 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VbDu0-0006ys-69 for pgsql-performance@postgresql.org; Tue, 29 Oct 2013 18:20:30 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id r9TIKNk6005576; Tue, 29 Oct 2013 14:20:23 -0400 From: Tom Lane To: Jim Nasby cc: Merlin Moncure , "pgsql-performance@postgresql.org" Subject: Re: Problems with hash join over nested loop In-reply-to: <526FE7D0.9000605@enova.com> References: <526EDDF7.3090102@enova.com> <13775.1383002035@sss.pgh.pa.us> <526FE086.4020903@enova.com> <3692.1383065114@sss.pgh.pa.us> <526FE7D0.9000605@enova.com> Comments: In-reply-to Jim Nasby message dated "Tue, 29 Oct 2013 11:52:32 -0500" Date: Tue, 29 Oct 2013 14:20:23 -0400 Message-ID: <5575.1383070823@sss.pgh.pa.us> X-Pg-Spam-Score: -2.4 (--) 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 Jim Nasby writes: > On 10/29/13 11:45 AM, Tom Lane wrote: >> Jim Nasby writes: >>> I'm also wondering if it's time to raise those limits. >> Yeah, possibly. The current default values were set on machines much >> smaller/slower than most current hardware. >> >> I think also that the collapse limits were invented mainly to keep people >> out of GEQO's clutches, but we've made some significant fixes in GEQO >> since then. Maybe the real answer is to make the default collapse limits >> much higher, and lower geqo_threshold to whatever we think the threshold >> of pain is for applying the regular planner. > In my test case geqo does seem to do a good job. I'll see if I can get some data on how number of relations affects planning time... I don't get much of a warm fuzzy about lowering geqo... Yeah, it's probably not that simple. A trawl through the archives reminded me that we've discussed this quite a bit in the past already. The collapse limits are important for the regular planner not only to limit runtime but also to limit planner memory consumption; moreover, GEQO doesn't behave all that well either with very large join problems. These facts killed a proposal back in 2009 to remove the collapse limits altogether. There was also some discussion in 2011, see thread here: http://www.postgresql.org/message-id/BANLkTin4ncKMg+bEixi1WB1RJPrZ5dVRgQ@mail.gmail.com but the general feeling seemed to be that we needed more planner infrastructure work first. In particular it seems like the best way forward might require limiting subproblem size using something more sophisticated than just "number of relations". 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