Skip site navigation (1) Skip section navigation (2)

Re: find close (duplicate) points + create index

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Elinor Medezinski <elinor(at)bellatrix(dot)tau(dot)ac(dot)il>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-novice(at)postgresql(dot)org
Subject: Re: find close (duplicate) points + create index
Date: 2004-03-14 00:13:33
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
On Wed, Mar 10, 2004 at 11:22:47 +0200,
  Elinor Medezinski <elinor(at)bellatrix(dot)tau(dot)ac(dot)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.

In response to

pgsql-novice by date

Next:From: ghaverlaDate: 2004-03-14 17:27:46
Subject: Re: find close (duplicate) points + create index
Previous:From: M. BastinDate: 2004-03-13 23:46:25
Subject: Re: PostgreSQL 7.2.1 on OS X -- psql: FATAL 1: user

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group