Re: find close (duplicate) points + create index - Mailing list pgsql-novice

From Bruno Wolff III
Subject Re: find close (duplicate) points + create index
Date
Msg-id 20040314001333.GA25927@wolff.to
Whole thread Raw
In response to Re: find close (duplicate) points + create index  (Elinor Medezinski <elinor@bellatrix.tau.ac.il>)
List pgsql-novice
On Wed, Mar 10, 2004 at 11:22:47 +0200,
  Elinor Medezinski <elinor@bellatrix.tau.ac.il> wrote:
>
> That much I know. I didn't find how I can use rtree to build an index on
> points, seeing how when I tried the following:
> "create INDEX Phot_point_a ON Phot USING RTREE (point_a);"
> I got this error:
> "ERROR:  data type point has no default operator class for access method
> "rtree"
> HINT:  You must specify an operator class for the index or define a default
> operator class for the data type."
>
> And then I found out that in postgres the only operator classes defined for
> rtree indexes are: bigbox_ops, box_ops and poly_ops. Neither of which works
> with points, only with type box and polygon. Therefore I also have to create
> an operator class. I didn't understand how to do that. Do you know how?

rtree indexes on points doesn't make sense since containment is the same
as equals. You want to use boxes. A point is a box with the same point
for both of the defining corners. When you do searches you use a box
that describes where you are looking and look for boxes (including points)
that are located in the search box.

You can also use the cube type and gist indexes to do the same thing.

pgsql-novice by date:

Previous
From: "M. Bastin"
Date:
Subject: Re: PostgreSQL 7.2.1 on OS X -- psql: FATAL 1: user
Next
From:
Date:
Subject: Re: find close (duplicate) points + create index