Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1aelpV-0001pX-Pf for pgsql-hackers@arkaria.postgresql.org; Sat, 12 Mar 2016 15:51:49 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aelpV-0000yL-Bl for pgsql-hackers@arkaria.postgresql.org; Sat, 12 Mar 2016 15:51:49 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aelpU-0000y3-MS for pgsql-hackers@postgresql.org; Sat, 12 Mar 2016 15:51:48 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aelpO-0000pb-3Z for pgsql-hackers@postgresql.org; Sat, 12 Mar 2016 15:51:47 +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 u2CFpd5b013158; Sat, 12 Mar 2016 10:51:39 -0500 From: Tom Lane To: "David G. Johnston" cc: David Rowley , 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> <24304.145748278! 0@sss.pgh.pa.us> <13653.1457731978@sss.pgh.pa.us> <16023.1457736190@sss.pgh.pa.us> Comments: In-reply-to "David G. Johnston" message dated "Sat, 12 Mar 2016 07:44:20 -0700" Date: Sat, 12 Mar 2016 10:51:39 -0500 Message-ID: <13157.1457797899@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-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org "David G. Johnston" writes: > Don't the semantics of a SEMI JOIN also state that the output columns only > come from the outer relation? i.e., the inner relation doesn't contribute > either rows or columns to the final result? Or is that simply > an implementation artifact of the fact that the only current way to perform > a semi-join explicitly is via exists/in? I think it's an artifact. What nodes.h actually says about it is you get the values of one randomly-selected matching inner row, which seems like a fine definition for the purposes we plan to put it to. 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