[postgis-users] PostGIS spatial query performance

Chris Hodgson chodgson at refractions.net
Fri Aug 9 09:22:48 PDT 2002


> >     For each feature in park
> >         see if there are any features in roads that are < 2km away
>
> >  And thats going to take a long time.
>
> Dave, is this really so? It thought it worked as a shortcut operator like
&&
> in C:
>
> for each feature in park
> see if it overlaps with any feature in roads
> and only if so, compute the distance
>
> As far as I know, lots of optimizing can be done within PostgreSQL by
> arranging selects, subselects and explicit joins. This would be especially
> important for the Java Topology Suite.

I think that Dave is pointing out that the "for each feature in park" part
of the statement is already on the path to a slow query - if you've got a
lot of park polygons, anyways... We're used to working with 100,000s of
features, and 100,000s of overlap checks is not going to be fast -
especially if you've got 100,000s of road segments as well.

Chris





More information about the postgis-users mailing list