<div dir="ltr">Hello list, <br><br>I am writing to seek your input on how to handle such an issue:<br><br>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.<br>
<br>Thanks in advance.<br>John<br><br></div>