<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7653.38">
<TITLE>RE: [postgis-devel] Another Data Point</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>I don't have my OpenJump available at the moment.<BR>
<BR>
Kevin or Paul you happen to have that? If not then I guess I can test tomorrow and<BR>
then Paul can do his little dance :)<BR>
<BR>
Though would make more sense for Paul to do it so we are testing on the same hardware.<BR>
<BR>
<BR>
-----Original Message-----<BR>
From: postgis-devel-bounces@postgis.refractions.net on behalf of Paul Ramsey<BR>
Sent: Wed 1/21/2009 2:50 PM<BR>
To: PostGIS Development Discussion<BR>
Subject: Re: [postgis-devel] Another Data Point<BR>
<BR>
Now can I do my little dance?<BR>
<BR>
uniontest=# SELECT geometrytype(_unite_garray_fast(ARRAY(SELECT<BR>
the_geom FROM sample_poly)));<BR>
 geometrytype<BR>
--------------<BR>
 MULTIPOLYGON<BR>
(1 row)<BR>
<BR>
Time: 24122.901 ms<BR>
uniontest=#<BR>
<BR>
<BR>
<BR>
On Wed, Jan 21, 2009 at 11:43 AM, Obe, Regina <robe.dnd@cityofboston.gov> wrote:<BR>
> Paul,<BR>
> I wouldn't proclaim victory on that alone.<BR>
><BR>
> Do another test.  20 seconds sounds a little too short.<BR>
> I'm not saying it isn't right and my memory may be wrong on the JTS result<BR>
> too.<BR>
> Besides JTS would have to collect geometries as well I imagine so you can't<BR>
> simply throw that out and proclaim victory.<BR>
><BR>
><BR>
> Test out<BR>
><BR>
> SELECT geometrytype(st_unite_garray(ARRAY(SELECT the_geom FROM<BR>
> sample_poly)))<BR>
><BR>
> Though that wouldn't be quite a true test either. But somewhere between the<BR>
> two would be the answer.<BR>
><BR>
><BR>
> -----Original Message-----<BR>
> From: postgis-devel-bounces@postgis.refractions.net on behalf of Paul Ramsey<BR>
> Sent: Wed 1/21/2009 1:58 PM<BR>
> To: PostGIS Development Discussion<BR>
> Subject: Re: [postgis-devel] Another Data Point<BR>
><BR>
> Well, just running this:<BR>
><BR>
> uniontest=# select geometrytype(collect(the_geom)) from sample_poly;<BR>
>   geometrytype<BR>
> --------------------<BR>
>  GEOMETRYCOLLECTION<BR>
> (1 row)<BR>
><BR>
> Time: 261624.195 ms<BR>
><BR>
> takes 251 of the 271 seconds the union operation took... the<BR>
> implication is that the GEOS portion of the work is on the order of 10<BR>
> seconds.<BR>
><BR>
> P.<BR>
><BR>
> On Wed, Jan 21, 2009 at 10:10 AM, Martin Davis <mbdavis@refractions.net><BR>
> wrote:<BR>
>> Could be...   It would be interesting to see whether GEOS is faster than<BR>
>> JTS.   Needs a test environment able to run both pieces of code on the<BR>
>> same<BR>
>> hardware.<BR>
>><BR>
>> Paul Ramsey wrote:<BR>
>>><BR>
>>> I got another run in, right near the end, and it showed that<BR>
>>> GEOSUnionCascaded took only about 50% of the time in that slice. There<BR>
>>> was still more memcpy'ing first. I bet GEOSUnionCascaded on its own<BR>
>>> would be as fast as JTS (or faster?).<BR>
>>><BR>
>>> P.<BR>
>>><BR>
>>> On Wed, Jan 21, 2009 at 9:05 AM, Paul Ramsey <pramsey@cleverelephant.ca><BR>
>>> wrote:<BR>
>>><BR>
>>>><BR>
>>>> Interesting! The Shark only samples for about 20 seconds, so I only<BR>
>>>> got the first 10% or so of the run, and the biggest user in that time<BR>
>>>> period memcpy'ing in LWGEOM_accum (postgis) and<BR>
>>>> advance_transition_function (pgsql). So we are spending a non-trivial<BR>
>>>> amount of time just accumulating the input...<BR>
>>>><BR>
>>>> P<BR>
>>>><BR>
>>>> On Wed, Jan 21, 2009 at 9:00 AM, Paul Ramsey <pramsey@cleverelephant.ca><BR>
>>>> wrote:<BR>
>>>><BR>
>>>>><BR>
>>>>> The glove is dropped indeed... why speculate when I have the Shark...<BR>
>>>>> time to see where our time goes...<BR>
>>>>><BR>
>>>>> P<BR>
>>>>><BR>
>>>>> On Wed, Jan 21, 2009 at 8:55 AM, Martin Davis <mbdavis@refractions.net><BR>
>>>>> wrote:<BR>
>>>>><BR>
>>>>>><BR>
>>>>>> Go for it, Regina!  The glove is dropped...<BR>
>>>>>><BR>
>>>>>> Although I suspect this test may simply be running into the slower<BR>
>>>>>> memory<BR>
>>>>>> performance due to any or all of Postgres, C, GEOS compared to good<BR>
>>>>>> ol'<BR>
>>>>>> Java...  Hard to beat that tuned JVM memory manager!<BR>
>>>>>><BR>
>>>>>> Obe, Regina wrote:<BR>
>>>>>><BR>
>>>>>>><BR>
>>>>>>> Ah I think JTS was able to do this in about 40-50 seconds.  And my<BR>
>>>>>>> version was able to beat out Kevin's nested by a small margin.  I'll<BR>
>>>>>>> retest on mine.<BR>
>>>>>>><BR>
>>>>>>> So I think we still need work here.<BR>
>>>>>>><BR>
>>>>>>> I'm curious what would happen if I combined the algorithm I wrote<BR>
>>>>>>> with<BR>
>>>>>>> the new ST_Union how things would fair.  In theory it should fair the<BR>
>>>>>>> same, but I'm not really using Martin's cascaded union algorithm to<BR>
>>>>>>> the<BR>
>>>>>>> letter.<BR>
>>>>>>><BR>
>>>>>>><BR>
>>>>>>> -----Original Message-----<BR>
>>>>>>> From: postgis-devel-bounces@postgis.refractions.net<BR>
>>>>>>> [<A HREF="mailto:postgis-devel-bounces@postgis.refractions.net">mailto:postgis-devel-bounces@postgis.refractions.net</A>] On Behalf Of<BR>
>>>>>>> Paul<BR>
>>>>>>> Ramsey<BR>
>>>>>>> Sent: Wednesday, January 21, 2009 12:50 AM<BR>
>>>>>>> To: PostGIS Development Discussion<BR>
>>>>>>> Cc: lee.keel@uai.com<BR>
>>>>>>> Subject: [postgis-devel] Another Data Point<BR>
>>>>>>><BR>
>>>>>>> Using the original sample set from Lee Keel,<BR>
>>>>>>><BR>
>>>>>>> With the old style ST_Union, 3 hours, 27 minutes:<BR>
>>>>>>><BR>
>>>>>>> uniontest=# select st_area(st_union(the_geom)) from sample_poly;<BR>
>>>>>>>     st_area<BR>
>>>>>>> --------------------<BR>
>>>>>>>  0.0324039850011104<BR>
>>>>>>> (1 row)<BR>
>>>>>>><BR>
>>>>>>> Time: 12419261.819 ms<BR>
>>>>>>><BR>
>>>>>>><BR>
>>>>>>> With the new cascaded ST_Union, 4 minutes, 30 seconds, or 46 times<BR>
>>>>>>> faster.<BR>
>>>>>>><BR>
>>>>>>> uniontest=# select st_area(st_union_fast(the_geom)) from sample_poly;<BR>
>>>>>>>     st_area<BR>
>>>>>>> --------------------<BR>
>>>>>>>  0.0324039850054305<BR>
>>>>>>> (1 row)<BR>
>>>>>>><BR>
>>>>>>> Time: 271618.181 ms<BR>
>>>>>>><BR>
>>>>>>><BR>
>>>>>>> That's one nasty data set.<BR>
>>>>>>><BR>
>>>>>>> P.<BR>
>>>>>>> _______________________________________________<BR>
>>>>>>> postgis-devel mailing list<BR>
>>>>>>> postgis-devel@postgis.refractions.net<BR>
>>>>>>> <A HREF="http://postgis.refractions.net/mailman/listinfo/postgis-devel">http://postgis.refractions.net/mailman/listinfo/postgis-devel</A><BR>
>>>>>>> -----------------------------------------<BR>
>>>>>>> The substance of this message, including any attachments, may be<BR>
>>>>>>> confidential, legally privileged and/or exempt from disclosure<BR>
>>>>>>> pursuant to Massachusetts law. It is intended<BR>
>>>>>>> solely for the addressee. If you received this in error, please<BR>
>>>>>>> contact the sender and delete the material from any computer.<BR>
>>>>>>> _______________________________________________<BR>
>>>>>>> postgis-devel mailing list<BR>
>>>>>>> postgis-devel@postgis.refractions.net<BR>
>>>>>>> <A HREF="http://postgis.refractions.net/mailman/listinfo/postgis-devel">http://postgis.refractions.net/mailman/listinfo/postgis-devel</A><BR>
>>>>>>><BR>
>>>>>>><BR>
>>>>>>><BR>
>>>>>><BR>
>>>>>> --<BR>
>>>>>> Martin Davis<BR>
>>>>>> Senior Technical Architect<BR>
>>>>>> Refractions Research, Inc.<BR>
>>>>>> (250) 383-3022<BR>
>>>>>><BR>
>>>>>> _______________________________________________<BR>
>>>>>> postgis-devel mailing list<BR>
>>>>>> postgis-devel@postgis.refractions.net<BR>
>>>>>> <A HREF="http://postgis.refractions.net/mailman/listinfo/postgis-devel">http://postgis.refractions.net/mailman/listinfo/postgis-devel</A><BR>
>>>>>><BR>
>>>>>><BR>
>>><BR>
>>> _______________________________________________<BR>
>>> postgis-devel mailing list<BR>
>>> postgis-devel@postgis.refractions.net<BR>
>>> <A HREF="http://postgis.refractions.net/mailman/listinfo/postgis-devel">http://postgis.refractions.net/mailman/listinfo/postgis-devel</A><BR>
>>><BR>
>>><BR>
>><BR>
>> --<BR>
>> Martin Davis<BR>
>> Senior Technical Architect<BR>
>> Refractions Research, Inc.<BR>
>> (250) 383-3022<BR>
>><BR>
>> _______________________________________________<BR>
>> postgis-devel mailing list<BR>
>> postgis-devel@postgis.refractions.net<BR>
>> <A HREF="http://postgis.refractions.net/mailman/listinfo/postgis-devel">http://postgis.refractions.net/mailman/listinfo/postgis-devel</A><BR>
>><BR>
> _______________________________________________<BR>
> postgis-devel mailing list<BR>
> postgis-devel@postgis.refractions.net<BR>
> <A HREF="http://postgis.refractions.net/mailman/listinfo/postgis-devel">http://postgis.refractions.net/mailman/listinfo/postgis-devel</A><BR>
><BR>
> ________________________________<BR>
><BR>
> The substance of this message, including any attachments, may be<BR>
> confidential, legally privileged and/or exempt from disclosure pursuant to<BR>
> Massachusetts law. It is intended solely for the addressee. If you received<BR>
> this in error, please contact the sender and delete the material from any<BR>
> computer.<BR>
><BR>
> ________________________________<BR>
><BR>
> Help make the earth a greener place. If at all possible resist printing this<BR>
> email and join us in saving paper.<BR>
><BR>
> _______________________________________________<BR>
> postgis-devel mailing list<BR>
> postgis-devel@postgis.refractions.net<BR>
> <A HREF="http://postgis.refractions.net/mailman/listinfo/postgis-devel">http://postgis.refractions.net/mailman/listinfo/postgis-devel</A><BR>
><BR>
><BR>
_______________________________________________<BR>
postgis-devel mailing list<BR>
postgis-devel@postgis.refractions.net<BR>
<A HREF="http://postgis.refractions.net/mailman/listinfo/postgis-devel">http://postgis.refractions.net/mailman/listinfo/postgis-devel</A><BR>
<BR>
</FONT>
</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>