index your data if you havent..<br><br><div class="gmail_quote">2010/4/1 iKey <span dir="ltr"><<a href="mailto:eike.lueders@gmail.com">eike.lueders@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
Hey,<br>
I've set up a Postgres database with Postgis support.<br>
Now I try to excecute the following query:<br>
<br>
SELECT DISTINCT p.*<br>
FROM punkte p, lines l<br>
WHERE l.tags LIKE '%"highway"="footway"%'<br>
    AND CONTAINS(BUFFER(l.the_geom, 500), p.the_geom)<br>
<br>
You can download the SQL's to create the tables from my server:<br>
<a href="http://thisisliving.info/sql.zip" target="_blank">http://thisisliving.info/sql.zip</a><br>
<br>
It should return all datasets from the table punkte that are within a buffer<br>
of 500m around the datasets of the lines table.<br>
Anyway the query works fine, but it's veeeeery slow. It takes about 10<br>
minutes to get the results (1969).<br>
Now my question is if there is a way to speed up the query a bit.<br>
All help is appreciated.<br>
Thank you<br>
Eike Lüders<br>
<font color="#888888"><br>
--<br>
View this message in context: <a href="http://old.nabble.com/Postgres-Postgis-query-very-slow-tp28106198p28106198.html" target="_blank">http://old.nabble.com/Postgres-Postgis-query-very-slow-tp28106198p28106198.html</a><br>

Sent from the PostGIS - User mailing list archive at Nabble.com.<br>
<br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
</font></blockquote></div><br>