Re: find close (duplicate) points + create index

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: find close (duplicate) points + create index
Дата
Msg-id 20040314001333.GA25927@wolff.to
обсуждение исходный текст
Ответ на Re: find close (duplicate) points + create index  (Elinor Medezinski <elinor@bellatrix.tau.ac.il>)
Список 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 по дате отправления:

Предыдущее
От: "M. Bastin"
Дата:
Сообщение: Re: PostgreSQL 7.2.1 on OS X -- psql: FATAL 1: user
Следующее
От:
Дата:
Сообщение: Re: find close (duplicate) points + create index