[postgis-users] BBOX coordinates and GiST

Paul Ramsey pramsey at refractions.net
Thu Jul 5 09:12:01 PDT 2007


We deliberately use floats for the index (and therefore the boxes) 
because it makes the indexes 50% smaller (and therefore more cachable, 
and therefore faster for large databases).  When the boxes are computed 
against the double inputs, they are ajusted outwards, to they are always 
slightly overdetermined... the index may pull slightly more values than 
it "needs" to, but it will never accidentally miss a record due to our 
type-truncation.

We feel that being a little overdetermined is well worth it for the 50% 
size reduction, particularly since the r-tree is almost always 
overdetermined anyways, and requires a second pass with a "real" spatial 
function like st_contains() or st_distance().

p

Bernhard Reimar Hoefle wrote:
> Hi!
> I do want to use the GiST index for Points and Multipoints. As it works on
> BBoxes, the BBoxes should be as small as possible.
> 
> If I'm right BBox coordinates are stored as float4. For large coordinates, such
> as 3212345611.34 the box coordinates are rounded/cut? to 3212345600.00. I guess
> that this behaviour cannot be changed because my coordinates have always more
> than 8 digits and therefore BBoxes in the spatial index overlap?
> 
> But why do I get different results, already using small/reduced coordinates, for
> POINT and MULTIPOINT objects?
> 
> Do I have to change the BBOXCACHE_BEHAVIOURS, if I want exact BBoxes, also for
> MULTIPOINTs?
> 
> Example:
> 
> POINT(-2.730 -5.679 536.27) | BOX(-2.73000001907349 -5.68000030517578,-2.7299997
> 8065491 -5.67999982833862)
> 
> MULTIPOINT(-4.5599999986589 -6.08999999985099 552.17,-1.92000000178814
> -4.12000000011176 536.28) | BOX(-6 -6.5,0 -4)
> 
> Thanks,
> Bernhard
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users


-- 

   Paul Ramsey
   Refractions Research
   http://www.refractions.net
   pramsey at refractions.net
   Phone: 250-383-3022
   Cell: 250-885-0632



More information about the postgis-users mailing list