[postgis-devel] Should EMPTY be spatially equal to self ?

Paragon Corporation lr at pcorp.us
Thu Jan 12 16:09:22 PST 2012


> I don't know how many people are using ST_Equals in a 
> supposedly fast query.
> Anyway, I didnt' research on why ~= isn't index bound, did you ?
> 
> --strk;
It's because we remarked it out and I think the reason we remarked it out in
2.0 is we don't want people using it and we should probably deprecate it
completely. So we removed it out of the index ops so that we can safely drop
it later without requiring people to relaod/reindex their data.

~= has a long history of being very confusing

1) It's meaning is different from the way PostgreSQL built-in types use it
e. similar types like postgresl built in goemetric and pgSphere
use it for something different.  I forget the exact meaning.

2) Pre-1.4. it did an exact geometric match -- essentially meaning the same
thing as  ST_OrderingEquals but when we took out the RECHECK
that changed and it became a bounding box equality basically the same as =
(except = is only indexable with a btree index and we needed
to put it = against btree because it gets used in ORDER BY, GROUP BY
3) So what happened is since our upgrade script can't drop operators (index
ones at least can't remember the others) we had an ugly situation where:

If you started with 1.4 your ~= meant bounding box equality
If you started with a version prior to 1.4 and upgraded to 1.4+, your ~=
meant geometric equality


So in the end we said -- we needed to come up with another opertor that is
gist indexable that means
bounding box equality. And = was out because its already used by btree.

Well that's my understanding.  I forget what we settled on or if we ended
that discussion.

Hope that helps,
Regina





More information about the postgis-devel mailing list