Re: Problem about postponing gathering partial paths for topmost scan/join rel

Поиск
Список
Период
Сортировка
От Richard Guo
Тема Re: Problem about postponing gathering partial paths for topmost scan/join rel
Дата
Msg-id CAMbWs4-bbPocLuRb2+tL-BRz_fEZAuj7ZS=QdcM7uCe_qtw2uA@mail.gmail.com
обсуждение исходный текст
Ответ на Problem about postponing gathering partial paths for topmost scan/join rel  (Richard Guo <guofenglinux@gmail.com>)
Ответы Re: Problem about postponing gathering partial paths for topmost scan/join rel
Список pgsql-hackers

On Wed, Jul 28, 2021 at 3:42 PM Richard Guo <guofenglinux@gmail.com> wrote:
To fix this problem, I'm thinking we can leverage 'root->all_baserels'
to tell if we are at the topmost scan/join rel, something like:

--- a/src/backend/optimizer/path/allpaths.c
+++ b/src/backend/optimizer/path/allpaths.c
@@ -3041,7 +3041,7 @@ standard_join_search(PlannerInfo *root, int levels_needed, List *initial_rels)
                         * partial paths.  We'll do the same for the topmost scan/join rel
                         * once we know the final targetlist (see grouping_planner).
                         */
-                       if (lev < levels_needed)
+                       if (!bms_equal(rel->relids, root->all_baserels))
                                generate_useful_gather_paths(root, rel, false);


Any thoughts?

Attach a patch to include the fix described upthread. Would appreciate
any comments on this topic.

Thanks
Richard 
Вложения

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

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: A qsort template
Следующее
От: Dean Rasheed
Дата:
Сообщение: Division by zero error in to_char(num, '9.9EEEE')