Re: Check SubPlan clause for nonnullable rels/Vars

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Check SubPlan clause for nonnullable rels/Vars
Дата
Msg-id 1849611.1667420765@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Check SubPlan clause for nonnullable rels/Vars  (Richard Guo <guofenglinux@gmail.com>)
Ответы Re: Check SubPlan clause for nonnullable rels/Vars  (Richard Guo <guofenglinux@gmail.com>)
Список pgsql-hackers
Richard Guo <guofenglinux@gmail.com> writes:
> While wandering around the codes of reducing outer joins, I noticed that
> when determining which base rels/Vars are forced nonnullable by given
> clause, we don't take SubPlan into consideration. Does anyone happen to
> know what is the concern behind that?

Probably just didn't bother with the case at the time.

> IMO, for SubPlans of type ALL/ANY/ROWCOMPARE, we should be able to find
> additional nonnullable rels/Vars by descending through their testexpr.

I think you can make something of this, but you need to be a lot more
paranoid than this patch is.

* I don't believe you can prove anything from an ALL_SUBLINK SubPlan,
because it will return true if the sub-query returns zero rows, no
matter what the testexpr is.  (Maybe if you could prove the sub-query
does return a row, but I doubt it's worth going there.)

* You need to explicitly check the subLinkType; as written this'll
consider EXPR_SUBLINK and so on.  I'm not really on board with
assuming that nothing bad will happen with sublink types other than
the ones the code is expecting.

* It's not apparent to me that it's okay to pass down "top_level"
rather than "false".  Maybe it's all right, but it could do with
a comment.

            regards, tom lane



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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: ssl tests aren't concurrency safe due to get_free_port()
Следующее
От: Daniel Gustafsson
Дата:
Сообщение: Re: pg_basebackup's --gzip switch misbehaves