Re: Question about pull_up_sublinks_qual_recurse

Поиск
Список
Период
Сортировка
От Andy Fan
Тема Re: Question about pull_up_sublinks_qual_recurse
Дата
Msg-id CAKU4AWoJLhTaoeRX0_sMRy+8peCDxJR+mgm76Oy9nikqGnfyhw@mail.gmail.com
обсуждение исходный текст
Ответ на Question about pull_up_sublinks_qual_recurse  (Andy Fan <zhihui.fan1213@gmail.com>)
Ответы Re: Question about pull_up_sublinks_qual_recurse
Список pgsql-hackers
Later we tried to pull up the EXISTS sublink to t1 OR t2 separately, since
this subselect referenced to t1 AND t2, so we CAN'T pull up the sublink. I
am thinking why we have to pull up it t1 OR t2 rather than JoinExpr(t1, t2),
I think the latter one is better.

After some more self review,  I find my proposal has the following side effects.

    select * from t1
    where exists (select 1 from t2
                  where exists (select 1 from t3
                               where t3.c = t1.c)
    and t2.a = t1.a);

In the above example,  the innermost sublink will be joined with
SemiJoin (t1 t2) in the patched version,  but joined with t1 in the current
master.  However, even if we set the JoinTree with
SemiJoin(SemiJoin(t1 t2), t3),  the join reorder functions can generate a
path which joins t1 with t3 first and then t2 still.  So any hint about this
patch's self-review is welcome. 

--
Best Regards
Andy Fan

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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: New docs chapter on Transaction Management and related changes
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Move backup-related code to xlogbackup.c/.h