Re: Better management of mergejoinable operators - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Better management of mergejoinable operators
Date
Msg-id 27876.1165968204@sss.pgh.pa.us
Whole thread Raw
In response to Re: Better management of mergejoinable operators  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
I wrote:
>>> Right offhand I cannot see a reason why there should be different
>>> equality operators with the same sortops.  (If anyone can come up with
>>> a plausible scenario for that, stop me here...)

BTW, I think it's possible to prove that there need never be two for the
case of both sides the same datatype.  If we have a sortop "A < B" on a
single datatype, then its commutator is well defined: "A > B" if and
only if "B < A".  And by the trichotomy law, "A = B" must be true in
exactly those cases for which neither "A < B" nor "A > B".  So there is
only one possible behavior for an equality operator that is consistent
with the sortop.  (This is, in fact, the reason that we can get away
with considering a single sortop as fully specifying a sort order.)

This argument doesn't immediately go through if A and B are of different
datatypes, but it's pretty hard to think of a case where it wouldn't
hold.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Casey Duncan
Date:
Subject: Re: psql commandline conninfo
Next
From: Neil Conway
Date:
Subject: Re: EXPLAIN ANALYZE