[postgis-devel] Prepared Geometry API

Paul Ramsey pramsey at cleverelephant.ca
Mon Oct 6 08:24:10 PDT 2008


On Mon, Oct 6, 2008 at 4:26 AM, Mark Cave-Ayland
<mark.cave-ayland at siriusit.co.uk> wrote:
> Also remember that as Tom pointed out,
> memcmp() exits as soon as it finds its first non-matching word and so the
> overhead should be very minimal.

Remember, it's not differences we're going to be finding, it's
similarities. My main test case was 8000 small geometries in 80 large
ones. That means a given spatial join did (at least) 8000 tests, and
for 7920 of them, the answer was "yep, the cached geometry is still
the same as the incoming geometry". Only in 80 of the tests was the
answer "geometries differ, recache!"

CRC approaches will need to make space in the LWGEOM structure for the
CRC, much like the bounding box, since computing the CRC on the fly
will be no cheaper than doing the memcmp.

Anyways, given the vociferousness of your response, I will have to
figure out how to do a head-to-head of keys versus memcmp. Meanwhile,
I do have a client with a desperate need for this functionality, and
maximum speed.

P.



More information about the postgis-devel mailing list