[postgis-devel] What's the differencebetweengeom_accum andbuiltinpostgresql array_append

Obe, Regina robe.dnd at cityofboston.gov
Wed Sep 3 05:26:40 PDT 2008


Is it bad to do this?  This feels like getting kind of close to the metal, but does avoid the sql penalty.

CREATE OR REPLACE FUNCTION st_geom_accum2(geometry[], geometry)
  RETURNS geometry[] AS
'array_push'
  LANGUAGE 'internal' IMMUTABLE;

With the above my timings before and after (windows 8.2 1.3.2 install)

(Before -  using the lwgeom_accum)

--4,938 ms (st_geom_accum aka lwgeom_accum)
SELECT ST_Numgeometries(ST_Collect(the_geom))
FROM towns;


-- 3,609 ms (using st_geom_accum2 - aka array_append)
SELECT ST_Numgeometries(ST_Collect2(the_geom))
FROM towns;

--max 28,904 points, avg 1595.77, numrecs: 351
SELECT Max(ST_NPoints(the_geom)), Avg(ST_NPoints(the_geom)), count(the_geom) as numrecs
FROM
towns

I'm going to test next with large water polys and try to standardize my sets across all boxes, but I guess for that I'll have to be a bit more patient.

Thanks,

Regina

 

 



-----------------------------------------
The substance of this message, including any attachments, may be
confidential, legally privileged and/or exempt from disclosure
pursuant to Massachusetts law. It is intended
solely for the addressee. If you received this in error, please
contact the sender and delete the material from any computer.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20080903/89b50f6c/attachment.html>


More information about the postgis-devel mailing list