Re: R-Trees in PostgreSQL

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: Viktor Rosenfeld <listuser36(at)googlemail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: R-Trees in PostgreSQL
Date: 2009-11-03 04:10:47
Message-ID: 407d949e0911022010n23e8e73cx95f6edb6d207bb59@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Nov 2, 2009 at 4:41 PM, Jeff Davis <pgsql(at)j-davis(dot)com> wrote:
> On Tue, 2009-11-03 at 00:25 +0100, Viktor Rosenfeld wrote:
>> I'd like to know what kind of functions I have to implement for a R-Tree
>> index on numeric columns,
>
> NUMERIC is scalar, so an R-Tree doesn't make much sense. You can install
> btree_gist (a contrib module) to be able to use numeric columns as part
> of a GiST index.

It sounds like what you're trying to do needs an "expression index" so
you can construct a data type which does support gist indexes out of
your two numeric columns. You could do something like create index i
on (point(col1,col2)) though I think you might have to actually make a
"box" instead. Alternatively you could look at the "cube" contrib
module. As far as i know all of these actually work with doubles
though, so you'll lose precision.

--
greg

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Đỗ Ngọc Trí Cường 2009-11-03 09:55:40 Connection Problems!
Previous Message Craig Ringer 2009-11-03 03:49:02 Re: 8.4 initdb failure