Re: Check SubPlan clause for nonnullable rels/Vars
От | Richard Guo |
---|---|
Тема | Re: Check SubPlan clause for nonnullable rels/Vars |
Дата | |
Msg-id | CAMbWs4_e=oapGYPsc+_XEyq0z2oML9uhXQhxPw_RoQ284whpMQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Check SubPlan clause for nonnullable rels/Vars (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: Check SubPlan clause for nonnullable rels/Vars
|
Список | pgsql-hackers |
On Thu, Nov 3, 2022 at 4:26 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
* 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.)
that the subplan produces zero rows. In this case ALL_SUBLINK will
always return true, and ANY_SUBLINK will always return false. That
makes ALL_SUBLINK not strict, and ANY_SUBLINK can be strict only at top
level.
* 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.
testexpr is only meaningful for ALL/ANY/ROWCOMPARE, and ALL_SUBLINK has
been proven not strict.
* 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.
The 'top_level' param is one point that I'm not very confident about.
I've added comments in the v2 patch.
Thanks for reviewing this patch!
Thanks
Richard
I've added comments in the v2 patch.
Thanks for reviewing this patch!
Thanks
Richard
Вложения
В списке pgsql-hackers по дате отправления: