[postgis-devel] Float vs Double Box

Sandro Santilli strk at keybit.net
Wed Nov 9 10:47:54 PST 2011


On Wed, Nov 09, 2011 at 09:43:14AM -0800, Paul Ramsey wrote:
> So, we've had this argument before, and Mark wanted double boxes for
> simplicity, and I wanted float boxes to keep index sizes down.
> 
> And I realized on the way into work that actually we could have both,
> in that we could serialized double boxes into the geometry objects,
> but build the index out of float boxes, since the *key* used by the
> index is actually a different structure from the geometries
> themselves.
> 
> My objection to doubles in the serialization was more concerned with
> index size than object size, since for small objects (points,
> two-vertex lines) we can just omit the boxes entirely. My objection to
> doubles for the index stands, 50% smaller is a big win for an index,
> but we can actually have float based indexes and double based
> serialization.
> 
> Anyhow, that's the good news.
> 
> The bad news it it's another dump/restore change that touches quite a
> pile of critical code, and we're supposed to be feature freezing in a
> couple weeks.

It's not a new feature, and people would need to dump/reload anyway
when coming from postgis < 2.0. I'm more concerned about alignment.
Will your coordinates still be aligned by changing that ?
Also, are we caching 2d boxes always, even for 3d or 4d geoms ?
Could be another nice thing to change.
BTW, did you leave a few zeroed-out bit to use for next time we need
to do such changes ? It would allow us to do w/out a dump/reload.

--strk; 

  ()   Free GIS & Flash consultant/developer
  /\   http://strk.keybit.net/services.html



More information about the postgis-devel mailing list