From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Michael Glaesemann <grzm(at)seespotcode(dot)net> |
Cc: | pgsql-hackers(at)postgreSQL(dot)org |
Subject: | Re: Better management of mergejoinable operators |
Date: | 2006-12-13 00:03:24 |
Message-ID: | 27876.1165968204@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | Neil Conway | 2006-12-13 00:49:32 | Re: EXPLAIN ANALYZE |
Previous Message | Casey Duncan | 2006-12-12 23:57:21 | Re: [HACKERS] psql commandline conninfo |