Re: Better management of mergejoinable operators

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Better management of mergejoinable operators
Дата
Msg-id 27876.1165968204@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Better management of mergejoinable operators  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Casey Duncan
Дата:
Сообщение: Re: psql commandline conninfo
Следующее
От: Neil Conway
Дата:
Сообщение: Re: EXPLAIN ANALYZE