[postgis-users] memory usage of st_clip/st_intersection in a session

Bergenroth, Brandon bbergenroth at rti.org
Tue Jun 2 11:39:49 PDT 2015


I have thousands of polygons that I clip/intersect with various rasters and calculate area-weighted values, etc.

I have created a function which returns a table of attributes and it works like a charm when calling it for a specific polygon and raster.  However when I call this function over and over again in a single session, the memory used by the PostgreSQL process continues to climb and instead of the function returning in the few seconds it normally does, it starts to take longer and longer and will just churn on one polygon for a long time to the point of never returning.  Now if I open another session and run that particular polygon it comes right back so I know it is not the data or the function.  

If I batch up the polygons and execute them in a new connection each time then they all finish in a timely manner.

It would be hard for me to produce a test case given the amount of data I'm working with, but is there anything I am obviously missing here?  It is not such a burden to do each one in a new connection but that is obviously not ideal.

Thanks for any suggestions.

Brandon Bergenroth


More information about the postgis-users mailing list