[postgis-devel] Prepared Geometry API

Obe, Regina robe.dnd at cityofboston.gov
Mon Oct 6 11:20:48 PDT 2008


Paul Ramsey wrote:
>> E.g. the left side of intersects will most always come from the same set of
>> data
>> and the right side of intersects will come from some other dataset.
>>
>> When we pull it out of the PG_DATAUM array or whatever isn't that pulling it
>> out based on some generated pointer already.  Why can't we just compare
>> these PG pointers and if they are the same its the same geometry.
> 
> That would indeed be ideal. More information is needed, however :)

> Theoretical counterexample: If postgres palloc()s for a geometry, then 
> pfree()s it, then palloc()s for the next geometry, and if the address 
> returned points to the same memory location as the previous palloc(), 
> then a pointer-caching technique would give a false positive.

> Only if you could guarantee a unique memory location for each geometry 
> seen in the (sub)query would that work.

I think it might be worth a shot to check and see if it reuses the same address space
consectively or maintains them all separately.  It would seem from an efficiency standpoint that it would not reuse the same address space in a given query.

If we conclude it uses different address space, then this would be the ideal solution.
I suppose we can't check the start and end address space.  Its unlikely that even if address space is reused, the end point would be the same. (but then as Martin says that's not terribly precise and we like our databases to give correct answers so lets scratch that).

Thanks,
Regina



-----------------------------------------
The substance of this message, including any attachments, may be
confidential, legally privileged and/or exempt from disclosure
pursuant to Massachusetts law. It is intended
solely for the addressee. If you received this in error, please
contact the sender and delete the material from any computer.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20081006/6334827d/attachment.html>


More information about the postgis-devel mailing list