Re: R-tree and start/end queries

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Sean Davis <sdavis2(at)mail(dot)nih(dot)gov>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: R-tree and start/end queries
Date: 2005-09-21 18:38:37
Message-ID: 20050921183837.GA27439@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Wed, Sep 21, 2005 at 13:52:40 -0400,
Sean Davis <sdavis2(at)mail(dot)nih(dot)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.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Chris Mungall 2005-09-21 19:13:44 Re: R-tree and start/end queries
Previous Message Sean Davis 2005-09-21 17:52:40 R-tree and start/end queries