pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruno Wolff III <bruno@wolff.to>
To: Sean Davis <sdavis2@mail.nih.gov>
Cc: pgsql-sql@postgresql.org
Subject: Re: R-tree and start/end queries
Date: Wed, 21 Sep 2005 13:38:37 -0500
Message-ID: <20050921183837.GA27439@wolff.to> (raw)
In-Reply-To: <BF571628.EF19%sdavis2@mail.nih.gov>
References: <BF571628.EF19%sdavis2@mail.nih.gov>

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.



view thread (5+ messages)  latest in thread

Message-ID: <20050921183837.GA27439@wolff.to>
Permalink:  ../20050921183837.GA27439@wolff.to/
Also on:    postgresql.org/message-id/20050921183837.GA27439@wolff.to

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: bruno@wolff.to, sdavis2@mail.nih.gov
  Subject: Re: R-tree and start/end queries
  In-Reply-To: <20050921183837.GA27439@wolff.to>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox