Re: BUG #12963: WHERE constraints on (INNER) JOIN columns are not propagated to both tables

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #12963: WHERE constraints on (INNER) JOIN columns are not propagated to both tables
Дата
Msg-id 26322.1428330924@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #12963: WHERE constraints on (INNER) JOIN columns are not propagated to both tables  (gcp@sjeng.org)
Список pgsql-bugs
gcp@sjeng.org writes:
> That is, when given:
>         join matches on matches.seq = matches_players.seq
>         where matches.seq > 1151575404 and matches.seq < 1155066769
> there should be no need to add:
>         and matches_players.seq > 1151575404 and matches_players.seq <
> 1155066769;
> because this is implied by the JOIN ON.

We do make deductions of this sort for equality constraints, but not for
inequalities.  There are no plans to teach the planner to do such
deductions.  Sorry, but for most queries trying to propagate inequalities
would just chew up planning cycles with little result.  The fact that when
it does apply it can be a big win doesn't convince me that it wouldn't be
a net loss overall.

            regards, tom lane

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

Предыдущее
От: Peter Slavov
Дата:
Сообщение: Re: BUG #12910: Memory leak with logical decoding
Следующее
От: cbalmeida@gmail.com
Дата:
Сообщение: BUG #12989: pg_size_pretty with negative values