Re: ERROR: no relation entry for relid 6

Поиск
Список
Период
Сортировка
От Richard Guo
Тема Re: ERROR: no relation entry for relid 6
Дата
Msg-id CAMbWs49=uXcRNfV3nH0LAgwpo2F=jYnbhOJqWOaaBT8x-vnHdw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: ERROR: no relation entry for relid 6  (Richard Guo <guofenglinux@gmail.com>)
Ответы Re: ERROR: no relation entry for relid 6  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers

On Tue, May 30, 2023 at 10:28 AM Richard Guo <guofenglinux@gmail.com> wrote:
I haven't thought through how to fix it, but I suspect that we may need
to do more checking before we decide to remove PHVs in
remove_rel_from_query.

Hmm, maybe we can additionally check if the PHV needs to be evaluated
above the join.  If so it cannot be removed.

--- a/src/backend/optimizer/plan/analyzejoins.c
+++ b/src/backend/optimizer/plan/analyzejoins.c
@@ -425,7 +425,8 @@ remove_rel_from_query(PlannerInfo *root, int relid, SpecialJoinInfo *sjinfo)

        Assert(!bms_is_member(relid, phinfo->ph_lateral));
        if (bms_is_subset(phinfo->ph_needed, joinrelids) &&
-           bms_is_member(relid, phinfo->ph_eval_at))
+           bms_is_member(relid, phinfo->ph_eval_at) &&
+           !bms_is_member(ojrelid, phinfo->ph_eval_at))
        {
            root->placeholder_list = foreach_delete_current(root->placeholder_list,
                                                            l);

Does this make sense?

Thanks
Richard

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

Предыдущее
От: Daniel Gustafsson
Дата:
Сообщение: Re: [16Beta1][doc] Add BackendType for standalone backends
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: PG 16 draft release notes ready