<HTML dir=ltr><HEAD><TITLE>RE: [postgis-devel] What's the difference betweengeom_accum andbuiltin postgresql array_append</TITLE>
<META http-equiv=Content-Type content="text/html; charset=unicode">
<META content="MSHTML 6.00.2900.5626" name=GENERATOR></HEAD>
<BODY>
<P>Is it bad to do this?  This feels like getting kind of close to the metal, but does avoid the sql penalty.</P>
<P>CREATE OR REPLACE FUNCTION st_geom_accum2(geometry[], geometry)<BR>  RETURNS geometry[] AS<BR>'array_push'<BR>  LANGUAGE 'internal' IMMUTABLE;</P>
<P>With the above my timings before and after (windows 8.2 1.3.2 install)</P>
<P>(Before -  using the lwgeom_accum)</P>
<P>--4,938 ms (st_geom_accum aka lwgeom_accum)<BR>SELECT ST_Numgeometries(ST_Collect(the_geom))<BR>FROM towns;</P>
<P><BR>-- 3,609 ms (using st_geom_accum2 - aka array_append)<BR>SELECT ST_Numgeometries(ST_Collect2(the_geom))<BR>FROM towns;</P>
<P>--max 28,904 points, avg 1595.77, numrecs: 351<BR>SELECT Max(ST_NPoints(the_geom)), Avg(ST_NPoints(the_geom)), count(the_geom) as numrecs<BR>FROM<BR>towns</P>
<P>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.</P>
<P>Thanks,</P>
<P>Regina</P>
<P> </P>
<P> </P></BODY></HTML>
<HTML><BODY><P><hr size=1></P>
<P><STRONG>
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.
</STRONG></P></BODY></HTML>

<P><hr size=1></P>
<P><STRONG><font size="2" color="339900"> Help make the earth a greener place. If at all possible resist printing this email and join us in saving paper. </p> <p> </font></STRONG></P>