Re: R-tree and start/end queries - Mailing list pgsql-sql

From Bruno Wolff III
Subject Re: R-tree and start/end queries
Date
Msg-id 20050921183837.GA27439@wolff.to
Whole thread Raw
In response to R-tree and start/end queries  (Sean Davis <sdavis2@mail.nih.gov>)
Responses Re: R-tree and start/end queries
List pgsql-sql
On Wed, Sep 21, 2005 at 13:52:40 -0400, Sean Davis <sdavis2@mail.nih.gov> wrote:
> I have a table like:
> 
> Create table gf (
>     pk    serial,
>     start int,
>     end   int,
>     gf    varchar
> );
> 
> I want to do queries along the lines of:
> 
> "find all gf that overlap with (10000,20000)" or
> "find all gf that overlap with each other"
> 
> And others.  I have read over the documentation, but I still remain unclear
> about how to implement R-tree indexing in this situation.  Any suggestions?

There is a built in type for line segments that uses floating point. That
will probably be usable by you directly unless the integers can can large
enough that precision is a problem. There is an overlaps operator for the
geometric types that could be used to answer your sample questions.


pgsql-sql by date:

Previous
From: Sean Davis
Date:
Subject: R-tree and start/end queries
Next
From: Chris Mungall
Date:
Subject: Re: R-tree and start/end queries