[postgis-devel] performance of force_collection()

Ron Mayer rm_postgis at cheapcomplexdevices.com
Fri Feb 25 00:30:37 PST 2005


strk at refractions.net wrote:
 > TYPE_SETTYPE and TYPE_GETTYPE both work on PG_LWGEOM.type,
 > so your patch is correct.
 >
 > The only problem is that using direct access of the serialized
 > form won't automatically add a bounding box cache, which is
 > a strategy we decided to engage for every function returning
 > a geometry (add a bbox cache if output geom is COMPLEX).

Well, I think force_2d() doesn't do this -- which is nice;
because otherwise the overhead of mapserver's
  force_collection(force_2d(the_geom))
probably would have a performance overhead of 30-40%.  :)


Is there a quick way of detecting the bounding box cache without
deserializing the object?  Then the function could do an early
exit only if it sees the bbox.


 > The following query would return a MULTIPOINT with no BBOX cache:
 > SELECT summary(force_collection(dropbbox('SRID=4;MULTIPOINT(0 0, 1 1)')))
 > Is that acceptable for everybody ?


I not, and if there's no other speedup, does anyone know
a trick to make mapserver not add the force_collection(force_2d())
wrapper for objects that are already 2D collections?   For that
matter, why does it want 2d collections anyway?  I guess I
try to find their mailing list and ask them...


 > On Thu, Feb 24, 2005 at 02:20:39PM -0800, Ron Mayer wrote:
 >>...force_collection...taking 15-20% of the performance
 >>of many of my queries ...
 >>force_collection() is always deserializing and re-serializing
 >>the geometry...apparently be quite expensive on large geometries.







More information about the postgis-devel mailing list