[postgis-users] Postgres/Postgis query very slow

strk strk at keybit.net
Thu Apr 1 02:44:16 PDT 2010


On Thu, Apr 01, 2010 at 02:35:09AM -0700, iKey wrote:
> 
> Hey,
> I've set up a Postgres database with Postgis support.
> Now I try to excecute the following query:
> 
> SELECT DISTINCT p.*
> FROM punkte p, lines l
> WHERE l.tags LIKE '%"highway"="footway"%'
>     AND CONTAINS(BUFFER(l.the_geom, 500), p.the_geom)

Blind guess:

- Use ST_DFullyWithin instead of buffer (major improvement expected)
- Use equality operator and an OR for tags rather than like (minor)
- Avoid the DISTINCT if not needed (minor)

--strk;

  ()   Free GIS & Flash consultant/developer
  /\   http://strk.keybit.net/services.html



More information about the postgis-users mailing list