Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 1B23E6327C9 for ; Fri, 3 Apr 2009 14:29:49 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 73737-02 for ; Fri, 3 Apr 2009 14:29:45 -0300 (ADT) Received: from mx1.hub.org (mx1.hub.org [200.46.208.106]) by mail.postgresql.org (Postfix) with ESMTP id 6ABC5632581 for ; Fri, 3 Apr 2009 14:29:47 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from outmail136041.authsmtp.com (outmail136041.authsmtp.com [62.13.136.41]) by mx1.hub.org (Postfix) with ESMTP id F04BA125A8A0 for ; Fri, 3 Apr 2009 14:29:46 -0300 (ADT) Received: from mail-c189.authsmtp.com (mail-c189.authsmtp.com [62.13.128.71]) by punt9.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id n33HTeTw006051; Fri, 3 Apr 2009 18:29:40 +0100 (BST) Received: from [192.168.0.4] (85-211-223-92.dyn.gotadsl.co.uk [85.211.223.92]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id n33HTcR0040353; Fri, 3 Apr 2009 18:29:39 +0100 (BST) Subject: Re: plpgsql arrays From: Simon Riggs To: Tom Lane Cc: Matthew Wakeling , pgsql-performance@postgresql.org In-Reply-To: <28595.1238767442@sss.pgh.pa.us> References: <603c8f070904030647u1c92e13ew53612ac0011ed7c1@mail.gmail.com> <28595.1238767442@sss.pgh.pa.us> Content-Type: text/plain Date: Fri, 03 Apr 2009 18:30:39 +0100 Message-Id: <1238779839.5444.220.camel@ebony.2ndQuadrant> Mime-Version: 1.0 X-Mailer: Evolution 2.12.0 Content-Transfer-Encoding: 7bit X-Server-Quench: 02b0c0c7-2075-11de-bc7b-001f29070be2 X-AuthRoute: OCdxZQATClZOTQEd DAteCiNZVAwpPBRK HVkIKg5MJUcNSQVJ NksadRtFaAZbbElD HGQLW11EUVV7W2p/ aAMfZQBDYEtPQQdo U1ZAQE1QEQdtHhxP WB0dKn0hFQVGfH5z YEUsX3RZXAp6dxR9 EU4HEnAEZWBldWEe BBVFJVBTIh5Kfh4T aFl/U3NfNGdJBC9q VzwLEgofGg96HWxN RhkCNksWCU8RBDct XHhs X-Authentic-SMTP: 61633235383639.kestrel.dmpriest.net.uk:1378/Kp X-Report-SPAM: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-Virus-Status: No virus detected - but ensure you scan with your own anti-virus system. X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200904/77 X-Sequence-Number: 33444 On Fri, 2009-04-03 at 10:04 -0400, Tom Lane wrote: > Matthew Wakeling writes: > > On Fri, 3 Apr 2009, Robert Haas wrote: > >> Why not just use SQL to do the join? > > > Because the merge condition is: > > > WHERE l1.start <= l2.end AND l2.start <= l1.end > > > and merge joins in postgres only currently cope with the case where the > > merge condition is an equals relationship. (snip) > I don't actually believe that a standard merge join algorithm will work > with an intransitive join condition ... I think it's a common enough problem that having a non-standard join algorithm written for that case would be interesting indeed. -- Simon Riggs www.2ndQuadrant.com PostgreSQL Training, Services and Support