Index on points

From: A B <gentosaker(at)gmail(dot)com>
To: postgresql Forums <pgsql-general(at)postgresql(dot)org>
Subject: Index on points
Date: 2010-09-23 10:45:52
Message-ID: AANLkTimXsxQnV+sa1+u9U1Hic1Kk2fdyEqZxhp3ehuPy@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello.

If I have a table like this

create table fleet ( ship_id integer, location point);

and fill it with a lot of ships and their locations and then want to
create an index on this to speed up operations on finding ships within
a certain region (let's say its a rectangular region), how do I do
this?

I tried:

CREATE INDEX my_index ON fleet USING gist ( box(location,location)); ?

and that command worked, but I have no idea why and what I have just
done. The docs are a little to advanced.

How should one do it?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Vick Khera 2010-09-23 12:42:13 Re: What was new in 8.4 & 8.3?
Previous Message Boris 2010-09-23 09:51:27 Unable to upgrade old cluster from 8.4 to 9.0