[postgis-users] PostGIS spatial query performance

Dave Blasby dblasby at refractions.net
Fri Aug 9 09:53:45 PDT 2002


> select park.*
> from park.roads
> where park.oid not in
>         ( select park.oid, park.the_geom, roads.the_geom
>           from park,roads
>           where park.the_geom && roads.the_geom
>          );

How about:

(SELECT	park.name FROM park)
EXCEPT
(
	<QUERY for all the park names you dont want>
)

If PARK.name isnt a unique identifier, use that column instead.  You can
join this result back to the PARK table to get any other columns.

EXCEPT is often called 'MINUS' in other SQL systems.

dave




More information about the postgis-users mailing list