[postgis-users] PostGIS - server side optimization

Paul Ramsey pramsey at refractions.net
Wed Jan 5 09:32:13 PST 2005


Ralph is correct, this is a data organization problem.
If you want a fast hack though, you could try this.
Create an "area" attribute (or "length") and populate it with an update. 
Then use:

select primary_key, AsText(geom) AS geometry
FROM yourtable
WHERE geom && GeometryFromText('yourbox')
ORDER BY area
LIMIT 200

Jordi Ferran wrote:

> SELECT primary_key, AsText(geom) AS geometry
> FROM "city-1_table"
> WHERE ( geom @ GeometryFromText('BOX3D(414758.439692
> 4596794.509,421338.876 4604365.807929513)', -1) )




More information about the postgis-users mailing list