Re: R-tree, order by, limit - Mailing list pgsql-general

From Volkan YAZICI
Subject Re: R-tree, order by, limit
Date
Msg-id 87hc89lhzn.fsf@alamut.mobiliz.com.tr
Whole thread Raw
In response to R-tree, order by, limit  ("Anton Belyaev" <anton.belyaev@gmail.com>)
Responses Re: R-tree, order by, limit  ("Anton Belyaev" <anton.belyaev@gmail.com>)
List pgsql-general
On Sun, 21 Sep 2008, "Anton Belyaev" <anton.belyaev@gmail.com> writes:
> SELECT * FROM towns where alt1 <= alt <= alt2 AND long1 <= long <=
> long2 ORDER BY population LIMIT 10;

You're absolutely on the wrong path. Don't try to implement a logic,
that has been implemented by PostgreSQL in the most possibly efficient
way in its bounds. See geographic data types[1] (e.g. box) and
geographic functions[2] (e.g. @> a.k.a contains).


Regards.

[1] http://www.postgresql.org/docs/current/interactive/datatype-geometric.html
[2] http://www.postgresql.org/docs/current/interactive/functions-geometry.html

pgsql-general by date:

Previous
From: "Anton Belyaev"
Date:
Subject: R-tree, order by, limit
Next
From: "Anton Belyaev"
Date:
Subject: Re: R-tree, order by, limit