[postgis-devel] Union/Collect/Aggregates

Paul Ramsey pramsey at cleverelephant.ca
Mon Apr 29 10:52:23 PDT 2019


So, this issue I feel is still not resolved,

https://github.com/postgis/postgis/pull/394

We've got an open ticket now now on upgrades potentially having issues
if they use ST_Union() in aggregates. I also have an open question
with respect to memory leaks in the case of query cancellation.

I feel like a less intrusive implementation would be to not convert
the individual geometries to GEOS in the transfer function, but to
collect them in an LWCOLLECTION instead, and do the work of conversion
and processing in the final function.

This would allow us to keep the shared transfn signature and avoid the
upgrade issues, and would also keep all the memory in the PgSQL memory
manager right up until finalfn, so cancellation during collection
becomes a non-issue.

I'll do this work if nobody else will, gritting my teeth as I do so,
since it's churn for a relatively rare use case (collecting more than
1GB of inputs for an output that will fit in less than 1GB).

P.


More information about the postgis-devel mailing list