Re: [GENERAL] Index on points

2010-09-26 Thread A B
Sorry, Gmail made med confused, my biggest "thank you" was to Richard Huxton, who showed me code that worked. 2010/9/26 A B : > 2010/9/25 Tom Lane : >> Jeff Davis writes: >>> There's no reason that there couldn't be a point <@ box operator in the >>> opclass, but nobody really uses these geometri

Re: [GENERAL] Index on points

2010-09-26 Thread A B
2010/9/25 Tom Lane : > Jeff Davis writes: >> There's no reason that there couldn't be a point <@ box operator in the >> opclass, but nobody really uses these geometric types that come with >> core postgres (at least, not that I can tell). > > Actually, as of 9.0 there is a point_ops opclass for GI

Re: [GENERAL] Index on points

2010-09-25 Thread Tom Lane
Jeff Davis writes: > There's no reason that there couldn't be a point <@ box operator in the > opclass, but nobody really uses these geometric types that come with > core postgres (at least, not that I can tell). Actually, as of 9.0 there is a point_ops opclass for GIST, with these indexable oper

Re: [GENERAL] Index on points

2010-09-25 Thread Jeff Davis
On Sat, 2010-09-25 at 09:18 +0200, A B wrote: > fleet (id bigserial primary key, location point); > ... > CREATE INDEX fleet_location ON fleet USING GIST ( box(location,location) ); > > but I still get almost exaclty the same run time of the query > > > explain analyze select count(1) from flee

Re: [GENERAL] Index on points

2010-09-25 Thread Richard Huxton
On 23/09/10 11:45, A B wrote: 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

Re: [GENERAL] Index on points

2010-09-25 Thread A B
But how do I do it without Postgis? Right now I have a table fleet (id bigserial primary key, location point); and I have filled it with random data and then tried selecting explain analyze select count(1) from fleet where location <@ box(point(300,300),point(600,600)); to gather runningtime da

Re: [GENERAL] Index on points

2010-09-23 Thread Jeff Davis
On Thu, 2010-09-23 at 12:45 +0200, A B wrote: > Hello. > > If I have a table like this > > create table fleet ( ship_id integer, location point); I recommend taking a look into PostGIS: http://postgis.org Regards, Jeff Davis -- Sent via pgsql-general mailing list (pgsql-general@po

[GENERAL] Index on points

2010-09-23 Thread A B
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

Re: [GENERAL] index on points

2000-10-10 Thread Tom Lane
Jeff Hoffmann <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> There is already support for r-tree indexes, but as far as I know the >> '@' operator is not connected up to indexes. > i'm just throwing this out without testing it, but i think something > like this might work: coerce both the poin

Re: [GENERAL] index on points

2000-10-10 Thread Jeff Hoffmann
Tom Lane wrote: > > Peter Keller <[EMAIL PROTECTED]> writes: > > Therefore we decided to use PostgreSQL as our DB. At this time we have > > the problem to find points in a polygon. In postgres you have the > > operator '@' to find points in a polygon. But if you have many points it > > is realy t

Re: [GENERAL] index on points

2000-10-10 Thread Tom Lane
Peter Keller <[EMAIL PROTECTED]> writes: > Therefore we decided to use PostgreSQL as our DB. At this time we have > the problem to find points in a polygon. In postgres you have the > operator '@' to find points in a polygon. But if you have many points it > is realy to slow without indexing the p