Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 52430635140 for ; Fri, 3 Apr 2009 16:03:47 -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 17929-04 for ; Fri, 3 Apr 2009 16:03:45 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ew0-f167.google.com (mail-ew0-f167.google.com [209.85.219.167]) by mail.postgresql.org (Postfix) with ESMTP id CAC6F6349D0 for ; Fri, 3 Apr 2009 16:03:45 -0300 (ADT) Received: by ewy11 with SMTP id 11so1635194ewy.19 for ; Fri, 03 Apr 2009 12:03:44 -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:content-type :content-transfer-encoding; bh=R4yXZ4OK3qwUDgeEJe5PvN/c5K3smNBmDHnDtktZ3o0=; b=WauUoEszrEpwCIJygR3FMIJCeibww7KAWqd+pSFggnaMKpAXjpA61ad9EIuiltbdGi z4aaxWF1dP4/zsCiJKSBLwqjYDyF6x2WTW/ZBgFbLF/HxBCWOrB0ZvkMTwlQuQme2YjC pf8Po9HjdjUEElRRTXWkRFSwacgzFvuRJ61kw= 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 :content-type:content-transfer-encoding; b=amDIoVrvAnDllwJGfOAOdQWMhRJILqFM4e22OyK819FxzSoPp+xAHNCPZ4euUIKY6F kjLX8kXyte4C0vkolsBrP6r/+uFbc4tgCfHryN8sBMCLmm5OeyAepZ+bVPNaDs/7S3HO VkeYVdXLF2LsInUAXSxQE6enkM/wjAk4YAxdM= MIME-Version: 1.0 Received: by 10.210.45.17 with SMTP id s17mr1129318ebs.74.1238785423628; Fri, 03 Apr 2009 12:03:43 -0700 (PDT) In-Reply-To: <1138.1238770111@sss.pgh.pa.us> References: <603c8f070904030647u1c92e13ew53612ac0011ed7c1@mail.gmail.com> <28595.1238767442@sss.pgh.pa.us> <29730.1238768681@sss.pgh.pa.us> <1138.1238770111@sss.pgh.pa.us> Date: Fri, 3 Apr 2009 12:03:43 -0700 Message-ID: <6fa3b6e20904031203m3867d02cnbc599c14b123d961@mail.gmail.com> Subject: Re: plpgsql arrays From: Nathan Boley To: pgsql-performance@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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/80 X-Sequence-Number: 33447 > Uh, no, it wouldn't. =A0Visually: > > =A0 =A0 =A0 =A0L1 =A0 =A0 =A0------------------------- > =A0 =A0 =A0 =A0L2 =A0 =A0 =A0----------- > =A0 =A0 =A0 =A0L3 =A0 =A0 =A0--------------------- > > =A0 =A0 =A0 =A0R1 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 -------- > > At L2, you'd conclude that you're done matching R1. > No, you should conclude that you're done matching L2. You conclude you're done matching R1 when you reach L4 ( or there exists a j st Lj.start > R1.end, or equivalently Lj is strictly greater than R1 ) FWIW, this is a very common problem in bioinformatics. I've mostly implemented this in python and C. The code is available at encodestatistics.org. Look in encode.py at the overlap method of the feature_region class, or ( for the C version ) region_overlap in block_bootstrap.c ( svn is more up to date for the C ). -Nathan