Re: Planner : anti-join on left joins

Поиск
Список
Период
Сортировка
От Richard Guo
Тема Re: Planner : anti-join on left joins
Дата
Msg-id CAMbWs4-m4-50RxF4cMnCvguAscAHr=ZS9GNzy+jgDjHM++0P4w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Planner : anti-join on left joins  (Tender Wang <tndrwang@gmail.com>)
Список pgsql-hackers
On Tue, Jan 6, 2026 at 10:47 AM Tender Wang <tndrwang@gmail.com> wrote:
> ...
> SELECT ... FROM a LEFT JOIN b ON (a.x = b.y) WHERE b.z IS NULL;
>  * If we can prove that b.z must be non-null for any matching row, either
>  * because the join clause is strict for b.z, or because b.z is defined NOT
>  * NULL by table constraints,
> ...
> How can the strict join clause influence b.z?

The logic 'strict for b.z' effectively applies only if b.z happens to
be the join key b.y.  To avoid confusion, I have rephrased the comment
to make this distinction clear.

I've also included a commit message, refined the comments throughout,
and added test cases in the updated patch.

Feedback and testing are very welcome.

- Richard

Вложения

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