Hi Jorge,<br><br><a href="http://ubuntuone.com/p/Yng/">Here's a dump of a problematic point table. </a><br>As a complement, I'd like to post the update query I'm using to fetch the values.<pre><font size="2"><span style="font-family: courier new,monospace;">UPDATE <table> AS pt </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">SET h = z - (SELECT value FROM</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">         (SELECT st_value(rs.rast, pt.the_geom) AS value</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">               FROM <raster> AS rs</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">                WHERE st_intersects(pt.the_geom, rs.rast) ) AS foo</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">           WHERE value > 0); -- last line to avoid getting nodata values (-9999)</span></font><i><br></i><i></i></pre>
Etienne<br>  

<pre>On Mon, Jan 17, 2011 at 7:50 PM, Etienne Bellemare <<a href="http://postgis.refractions.net/mailman/listinfo/postgis-devel">etiennebr at gmail.com</a>> wrote:<br>><i> Hi all,<br></i>><i><br></i>><i> I have points tables containing 1-2M (lidar) points and a raster containing<br>
</i>><i> 750k tiles of 100x100 pixels. So I'd like to get the value of the raster for<br></i>><i> each point coordinate. But I run out of memory. I was quite surprised to see<br></i>><i> it was actually possible to run out of memory with PostgeSQL as I thought it<br>
</i>><i> would switch to disk when the 3Gb RAM memory would fill (I've seen the<br></i>><i> process go as high as 1,7 Gb according to the task manager). But indeed it<br></i>><i> seems it's possible to run out of memory. The disk containing the db still<br>
</i>><i> have 900 Gb of free space.  The solutions I've seen so far on the web look<br></i>><i> more like production database solutions. Mine is actually for research<br></i>><i> purpose : I'm the only one making transactions on it so I don't have many<br>
</i>><i> queries running at the same time. Furthermore, I'm not a db ninja, so<br></i>><i> messing around with all these settings... I wasn't sure to say the least.<br></i>><i><br></i>><i> I couldn't isolate a single factor to the bug. Of course, point table size<br>
</i>><i> looks like a factor, the biggest table succeding was 467Mb ( I have tables<br></i>><i> of size up to 600Mb). But some 200 Mb tables ran out of memory while other<br></i>><i> went OK. Other factor seems to be the tiles (low number of tiles<br>
</i>><i> intersecting the point table, more likely to not run out of memory.) So, I'm<br></i>><i> calling for some input on either tests to perform to isolate the bug factors<br></i>><i> or to avoid running out of memory.<br>
</i>><i><br></i>><i> Etienne<br></i>><i><br></i>><i> _______________________________________________<br></i>><i> postgis-devel mailing list<br></i>><i> <a href="http://postgis.refractions.net/mailman/listinfo/postgis-devel">postgis-devel at postgis.refractions.net</a><br>
</i>><i> <a href="http://postgis.refractions.net/mailman/listinfo/postgis-devel">http://postgis.refractions.net/mailman/listinfo/postgis-devel</a><br></i>><i><br></i>><i><br></i><br>Hi Etienne,<br><br>Could you please provide a dump of one table causing the error?<br>
<br>Best regards,<br><br>-- <br>Jorge Arévalo<br>Internet & Mobilty Division, DEIMOS<br><a href="http://postgis.refractions.net/mailman/listinfo/postgis-devel">jorge.arevalo at deimos-space.com</a><br><a href="http://mobility.grupodeimos.com/">http://mobility.grupodeimos.com/</a><br>
<a href="http://gis4free.wordpress.com/">http://gis4free.wordpress.com</a><br><a href="http://geohash.org/ezjqgrgzz0g">http://geohash.org/ezjqgrgzz0g</a><br></pre><br>