UNIQUE_PATH_NOOP is dead code?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема UNIQUE_PATH_NOOP is dead code?
Дата
Msg-id 29448.1549167879@sss.pgh.pa.us
обсуждение исходный текст
Список pgsql-hackers
I happened to notice while looking at code coverage reports that

(1) the portions of create_unique_path() that report that the input
relation is already known unique are no longer reached in our
regression tests;

(2) the loop in relation_has_unique_index_for() that deals with
an exprlist and oprlist supplied by the caller is never iterated.
This is related to (1) because create_unique_path() is the only
caller that supplies such lists.

While I've not looked at it really closely, I suspect that this
is not just an indication of inadequate testing, but that those
sections are actually dead code now.  create_unique_path() is
only used on a relation that is the RHS of a semijoin, and light
testing suggests that in the cases that create_unique_path()
knows about, analyzejoins.c will have strength-reduced the
semijoin to a plain join.  All this code predates the introduction
of that phase, so it was useful when written, but maybe it's
not anymore.

Not planning to do anything about this observation right at this
moment, but perhaps we could remove some code here.

            regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Noah Misch
Дата:
Сообщение: Synchronize with imath upstream
Следующее
От: Andrew Gierth
Дата:
Сообщение: Re: Ryu floating point output patch