Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 02597633365 for ; Mon, 6 Apr 2009 11:36:54 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 42796-03 for ; Mon, 6 Apr 2009 11:36:52 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.248]) by mail.postgresql.org (Postfix) with ESMTP id A262563336F for ; Mon, 6 Apr 2009 11:36:52 -0300 (ADT) Received: by an-out-0708.google.com with SMTP id c5so1405354anc.28 for ; Mon, 06 Apr 2009 07:36:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=63z/a7DKDEAbXA7/h41i3GIOTdLBi7daNCHWE9omtp4=; b=s/CCPZ4GLMHDEx+TRrqGYpxzSPvMBQeZXgGvgJ2XF4dThqslI7nkitoTBMsOz3lRuS FA6tkDeeooe2KM+xcpCmbxSDywcrBvhgu08jvC0v9VoLVufIS1V11KiUk8O5RCvsxCdc VCDNMK9OAcWpkPq08X2xfPqi//1LhOVHsXUqQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=PFjZc/i6pStBr2u9vxjMZSa4AVxdX0HUQ1MUQAiuresgcTY43fIQl2EUi3ZpHuEsTr 9XQ7gsUV0r0tIaYN58cFgjjkcUrxdfsDzlob4WH6uD9ntg26ibz3dxpiQBveP7ZePDrY W1K8aJxBBwXtKv1fZyKZqkJRr1yOwT8+n3TmQ= MIME-Version: 1.0 Received: by 10.100.240.9 with SMTP id n9mr7058028anh.135.1239028610663; Mon, 06 Apr 2009 07:36:50 -0700 (PDT) In-Reply-To: References: <603c8f070904030647u1c92e13ew53612ac0011ed7c1@mail.gmail.com> <28595.1238767442@sss.pgh.pa.us> <1238779839.5444.220.camel@ebony.2ndQuadrant> Date: Mon, 6 Apr 2009 10:36:50 -0400 Message-ID: <603c8f070904060736s1a4e7868r5a1b6a5bbe8a2f26@mail.gmail.com> Subject: Re: plpgsql arrays From: Robert Haas To: Matthew Wakeling Cc: pgsql-performance@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200904/129 X-Sequence-Number: 33496 On Mon, Apr 6, 2009 at 8:52 AM, Matthew Wakeling wrote: > On Fri, 3 Apr 2009, Simon Riggs wrote: >> >> 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. >>> >>> 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. > > I'm currently trying to persuade my boss to give me time to do some work to > implement this in Postgres. It's not something I will be able to start right > away, but maybe in a little while. > > I'm currently seeing this as being able to mark overlap constraints ("&&" in > quite a few data types) as "OVERLAP_MERGES", and have the planner be able to > use the new merge join algorithm. So it wouldn't help with the exact query > above, but would if I rewrote it to use the bioseg or spacial data types' > overlap operators. > > I will need a little help as I am not incredibly familiar with the Postgres > innards. Would someone be able to do that? I can help review if you post a patch, even if it's WIP. But you should post it to -hackers, not here. ...Robert