This topic describes the ST_MemUnion function. This function returns a geometry object that represents the union of input geometry objects. This function is the same as the ST_Union function.

Syntax

geometry  ST_MemUnion(geometry set  geomfield);

Parameters

Parameter Description
geomfield The field of the geometry object that you want to specify in the geometry set.

Description

This function is the same as the ST_Union function. However, this function consumes less memory and requires more time to return results than the ST_Union function.

Examples

Results returned by using the default parameter settings:
select ST_asText(ST_MemUnion(g))
         from (select unnest(array['POLYGON((0 0,1 0,1 2,0 2,0 0))'::geometry,'POLYGON((1 0,3 0,3 1,1 1,1 0))'::geometry]) as g) as t;
                 st_astext
--------------------------------------------
 POLYGON((1 0,0 0,0 2,1 2,1 1,3 1,3 0,1 0))
(1 row)