[postgis-users] GeometryCollection vs LineString speed

strk at refractions.net strk at refractions.net
Wed Feb 23 01:18:57 PST 2005


Ron, if your LINESTRINGS didn't get a BBOX cache this is a bug
somewere. Can you remember how did you create those LINESTRINGS ?
Canonical input automatically adds one:

test=# select summary('LINESTRING(0 0, 1 1)');
         summary
-------------------------

Line[B] with 2 points

test=# select summary(dropbbox('LINESTRING(0 0, 1 1)'));
        summary
------------------------

Line[] with 2 points


Could it be you populated the tables before we enforced bbox caching ?

The file lwgeom/BBOXCACHE_BEHAVIOURS documents behaviours of all
functions returning a geometry.

--strk;

On Wed, Feb 23, 2005 at 01:22:41AM -0800, Ron Mayer wrote:
> strk at refractions.net wrote:
> >What postgis version ?
> 
> CVS as of earlier today.
> 
> Ron Mayer wrote:
> > Should I expect "&&" to be much faster on GeometryCollections
> > than on LineStrings?
> 
> I think I mostly figured it out.
> 
> I created another table, totally identical to the first,
> but created the LINIESTRINGS with AddBBOX() as suggested here:
>   http://postgis.refractions.net/docs/ch06.html#addbbox
> This new table with linestrings behaves exactly as good as
> the one with GEOMETRYCOLLECTION.  I'm guessing geometrycollections
> have the bbox by default and linestrings don't (but I didn't
> read the docs carefully enough to notice).
> 
> 
> So anyway, my problem's solved; but I'm still curious about
> a couple things.
> 
>  * Too bad the index didn't seem to cache the bbox "magically"
> 
>  * Would "addbbox()" be a good thing to mention on the new
>    performance typs documentation page:
>    http://postgis.refractions.net/docs/ch05.html
>    I had looked there; but didn't notice addbbox until later.
> 
> 
> 
> Just for completeness, here are the final times:
> 
> >     TIME     | what..
> >   -----------+-----------------------------------
> >   3.71 sec   | seq scan using LINESTRING
> >   1.51 sec   | seq scan using GEOMETRYCOLLECTION
>     1.45 sec   | seq scan using LINESTRING and AddBBox()
> >     .59 sec  | index scan using LINESTRING
> >     .37 sec  | index scan using GEOMETRYCOLLECTION
>       .36 sec  | index scan using LINESTRING and AddBBox()
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users



More information about the postgis-users mailing list