[postgis-users] 'Within' slows down query performance

Alexander Pucher pucher at atlas.gis.univie.ac.at
Fri Mar 26 07:46:02 PST 2004


Hi all,

need once again some help to speed up my PostGIS query.

As a first step, I buffer a multipoint table (settlements) and store the 
buffer result in a temporary table (buffer_123)
As a next step, I want to select all airports within this buffer with 
this query:

select distinct(gid),* from airport_them
where
    (airport_them.gid = airport.gid)
and
    (within(airport.the_geom,buff_123.buffer))

is this the correct way to do such a thing? It takes about a minute to 
get the result.

Any help is very appreciated,
regards,
alex.



More information about the postgis-users mailing list