Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WXGKZ-0000HB-Do for pgsql-bugs@arkaria.postgresql.org; Mon, 07 Apr 2014 20:39:47 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WXGKY-0005mA-T7 for pgsql-bugs@arkaria.postgresql.org; Mon, 07 Apr 2014 20:39:46 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WXGKX-0005ki-DQ for pgsql-bugs@postgresql.org; Mon, 07 Apr 2014 20:39:45 +0000 Received: from mimolette.dalibo.net ([212.85.154.222]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WXGKQ-0006YU-G4 for pgsql-bugs@postgresql.org; Mon, 07 Apr 2014 20:39:45 +0000 Received: from [192.168.0.19] (ip-68.net-81-220-133.standre.rev.numericable.fr [81.220.133.68]) by mimolette.dalibo.net (Postfix) with ESMTPSA id 452D26A2EE3; Mon, 7 Apr 2014 22:39:33 +0200 (CEST) Message-ID: <53430D00.9040009@dalibo.com> Date: Mon, 07 Apr 2014 22:39:28 +0200 From: Vik Fearing User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Tom Lane , pgsql-bugs@postgresql.org Subject: Re: BUG #9896: Bug in FULL OUTER JOIN References: <20140407131705.342.75513@wrigleys.postgresql.org> <19141.1396884331@sss.pgh.pa.us> <28747.1396901878@sss.pgh.pa.us> In-Reply-To: <28747.1396901878@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On 04/07/2014 10:17 PM, Tom Lane wrote: > I wrote: >> sqlpro@sqlspot.com writes: >>> SELECT * >>> FROM T_CLIENT_CLI AS C >>> FULL OUTER JOIN T_PROSPECT_PSP AS P >>> ON C.CLI_SIREN = P.PSP_SIREN >>> OR C.CLI_ENSEIGNE = P.PSP_ENSEIGNE; >> Can you show us the query plans used by those systems? > For the archives' sake: the OP sent me a not-too-useful screen shot > in which SQL Server claims it's using a merge join for this query. > > I find this less than credible: what linear sort order would bring > together all the potentially joinable rows? If they're getting the > right answer at all, there must be some secret sauce in there someplace. > Perhaps they're just Doing It The Hard Way with state storage > proportional to the size of the relations? And Oracle does it in two steps: http://www.sqlfiddle.com/#!4/607e0/1/0 -- Vik -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs