[postgis-users] Slow Postgres Query

dassouki dassouki at gmail.com
Thu Oct 1 09:13:03 PDT 2009


>>/ Hey All,
/>>/
/>>/ As some of you know, I've been trying to connect a point from a point table
/>>/ to the projection of that point on the nearest line for close to forever
/>>/ now.
/>>/
/>>/ I've managed to get the code working for a small set of points and lines;
/>>/ however, on a 60 node with 2,000 lines, the query is in its 11th hour and
/>>/ still no sign of ending.
/>>/
/>>/ I posted a question including code on stack overflow
/>>/ http://stackoverflow.com/questions/1504353/slow-postgres-query
/>>/
/>>/ I was wondering if anyone here has any idea on what I might be doing wrong
/>>/ ? and if there is a way to make the code more efficient
/>>/
/>>/
/> Hum, I am no expert but it looks like your 3000000 is way too high. 

I tried 1, 100, and 10000 and it didn't seem to speed up the query

> I think you need to tune your query to values that makes more sense in your current
> srid.

I tried it with 2200, 4326, 3348, and 32767. Again it works quiet swiftly on a small data set.

> I am using the same function on a table with a huge number of lines (read
> several millions), and it works quite fast for me.

For some reason I didn't have a problem selecting from the data when I went through the example, but perhaps my problem is syntax related, I went through the logic a few times and I'm not sure what I might have done wrong
> 
> Emilie Laffray




More information about the postgis-users mailing list