[postgis-users] Out of Memory problem for large table by ST_Contains(..)

John Zhang johnzhang06 at gmail.com
Tue Oct 21 15:28:54 PDT 2008


Hello list,

I am writing to seek your input on how to handle such an issue:

I have a large table containing over 3 million polygons and a small table
containing 53k points. My function is to identify whether a point in the
table is Contained by a polygon in the polygon table. ST_Contains function
is effectively used for this purpose (it takes about 2 seconds for  given
known polygon: "polyG && ptG AND ST_Contains(polyG, ptG)" is used where
polyG an ptG are the geometries of the point an dpolygon). However, with a
given pt, it crashes to run through all the polygons with the reason given
"Out of memory for query" in about 300 seconds. I then tested with select
count(*) of the polygon table, it takes 100 seconds as well. It seems there
is something wrong in the database configuration. I could not figure out
what is wrong there. Could anyone help on the issue? Any input would be much
appreciated.

Thanks in advance.
John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20081021/10a66110/attachment.html>


More information about the postgis-users mailing list