Re: Index on points

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Holger Klawitter <lists(at)klawitter(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Index on points
Date: 2004-06-08 13:08:24
Message-ID: 20040608130824.GA1291@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Jun 08, 2004 at 14:17:57 +0200,
Holger Klawitter <lists(at)klawitter(dot)de> wrote:
>
> Hi there,
>
> which operator class can I use in order to search points by distance like in:
>
> SELECT p FROM tbl WHERE (p <-> point(0,0)) < 10;
>
> - From what I've seen, there is none - which surprises me ...

You want to create a box that includes all points that might match
and use that to do an index search (using an rtree index) and then
check that the distance is really less than whatever.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John Liu 2004-06-08 13:56:42 Re: core dump
Previous Message Manfred Koizar 2004-06-08 12:48:52 Re: problem with inserting a generated seq no into not null field