Re: Making Vars outer-join aware
От | Richard Guo |
---|---|
Тема | Re: Making Vars outer-join aware |
Дата | |
Msg-id | CAMbWs4-mvPPCJ1W6iK6dD5HiNwoJdi6mZp=-7mE8N9Sh+cd0tQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Making Vars outer-join aware (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: Making Vars outer-join aware
|
Список | pgsql-hackers |
On Fri, Aug 19, 2022 at 2:45 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
Here's a rebase up to HEAD, mainly to get the cfbot back in sync
as to what's the live patch.
Noticed another different behavior from previous. When we try to reduce
JOIN_LEFT to JOIN_ANTI, we want to know if the join's own quals are
strict for any Var that was forced null by higher qual levels. We do
that by checking whether local_nonnullable_vars and forced_null_vars
overlap. However, the same Var from local_nonnullable_vars and
forced_null_vars may be labeled with different varnullingrels. If that
is the case, currently we would fail to tell they actually overlap. As
an example, consider 'b.i' in the query below
# explain (costs off) select * from a left join b on a.i = b.i where b.i is null;
QUERY PLAN
---------------------------
Hash Left Join
Hash Cond: (a.i = b.i)
Filter: (b.i IS NULL)
-> Seq Scan on a
-> Hash
-> Seq Scan on b
(6 rows)
Thanks
Richard
JOIN_LEFT to JOIN_ANTI, we want to know if the join's own quals are
strict for any Var that was forced null by higher qual levels. We do
that by checking whether local_nonnullable_vars and forced_null_vars
overlap. However, the same Var from local_nonnullable_vars and
forced_null_vars may be labeled with different varnullingrels. If that
is the case, currently we would fail to tell they actually overlap. As
an example, consider 'b.i' in the query below
# explain (costs off) select * from a left join b on a.i = b.i where b.i is null;
QUERY PLAN
---------------------------
Hash Left Join
Hash Cond: (a.i = b.i)
Filter: (b.i IS NULL)
-> Seq Scan on a
-> Hash
-> Seq Scan on b
(6 rows)
Thanks
Richard
В списке pgsql-hackers по дате отправления: