[postgis-devel] Recheck Considered Harmful (or, at least, Slow)

David Fuhry dfuhry at acm.org
Sun Oct 12 15:44:43 PDT 2008


David Fuhry wrote:
> 
> Paul Ramsey wrote:
>> The only downside I can see is that, for very small objects and
>> objects without bounding boxes (points) it is hard to avoid detoasting
>> *twice*, once to see if the bbox is there, and a second time after the
>> first attempt fails.
> 
> For 2D points with no SRID, your PG_DETOAST_DATUM_SLICE call has already 
> pulled all of the data, right?  (VARHDRSZ + 1 + sizeof(BOX2DFLOAT4) == 
> VARHDRSZ + 1 + sizeof(double) * 2)  If you have it pull four more bytes, 
> data retrieved by the _SLICE call can cover the 2D-point-with-SRID case, 
> too.

Or actually no, _SLICEing four more bytes will cover all point cases, 
since a point's Z or M ordinates would not be used to determine 
_consistent-cy.

So, no double DETOASTing for points in either case then.

-Dave




More information about the postgis-devel mailing list