Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aoBE6-0001PB-4d for pgsql-hackers@arkaria.postgresql.org; Thu, 07 Apr 2016 14:48:06 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1aoBE5-0001Fw-IB for pgsql-hackers@arkaria.postgresql.org; Thu, 07 Apr 2016 14:48:05 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1aoBCe-00085E-9b for pgsql-hackers@postgresql.org; Thu, 07 Apr 2016 14:46:36 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1aoBCX-0003Il-KV for pgsql-hackers@postgresql.org; Thu, 07 Apr 2016 14:46:35 +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 u37EkQpU016004; Thu, 7 Apr 2016 10:46:26 -0400 From: Tom Lane To: David Rowley cc: Tomas Vondra , Simon Riggs , PostgreSQL-development Subject: Re: Performance improvement for joins where outer side is unique In-reply-to: References: <20150320.121140.148610378.horiguchi.kyotaro@lab.ntt.co.jp> <27152324.eFKJb4Khb5@dinodell> <8608754a32d1325c2f83ba8b1df71585@xs4all.nl> <55DA1F9F.5040204@2ndquadrant.com> <5085.1440375543@sss.pgh.pa.us> <8907.1440383377@sss.pgh.pa.us> <56718B15.6060507@2ndquadrant.com> <5671FF0D.2010403@2ndquadrant.com> <56A25A72.2090505@2ndquadrant.com> <13653.145773197! 8@sss.pgh.pa.us> <16023.1457736190@sss.pgh.pa.us> <30364.1459529562@sss.pgh.pa.us> <21641.1459958757@sss.pgh.pa.us> Comments: In-reply-to David Rowley message dated "Thu, 07 Apr 2016 13:07:32 +1200" Date: Thu, 07 Apr 2016 10:46:26 -0400 Message-ID: <16003.1460040386@sss.pgh.pa.us> X-Pg-Spam-Score: -2.9 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org David Rowley writes: > I've attached an updated patch which introduces JOIN_INNER_UNIQUE and > JOIN_LEFT_UNIQUE. So unique inner joins no longer borrow JOIN_SEMI. OK. > In EXPLAIN, I named these new join types "Unique Inner" and "Unique > Left". Hm. I'm back to being unhappy about the amount of churn introduced into the regression test outputs by this patch. I wonder whether we could get away with only mentioning the "unique" aspect in VERBOSE mode. I'm also a bit suspicious of the fact that some of the plans in aggregates.out changed from merge to hash joins; with basically no stats at hand in those tests, that seems dubious. A quick look at what the patch touched in costsize.c suggests that this might be because you've effectively allowed cost_hashjoin to give a cost discount for inner unique, but provided no similar intelligence in cost_mergejoin. > I know we're close to the feature freeze, so I just want to say that > I'll be AFK starting 5:30am Friday New Zealand time (13:30 on the 8th > New York time), until Sunday ~4pm. Understood. I don't know if we'll get this in or not, but I'll work on it. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers