Re: postgres_fdw: wrong results with self join + enable_nestloop off

Поиск
Список
Период
Сортировка
От Richard Guo
Тема Re: postgres_fdw: wrong results with self join + enable_nestloop off
Дата
Msg-id CAMbWs49bcyHQU0Bb6RxauD1LLDWJfPUUa9nMcoJ7+oFv2Ajw1A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: postgres_fdw: wrong results with self join + enable_nestloop off  (Etsuro Fujita <etsuro.fujita@gmail.com>)
Ответы Re: postgres_fdw: wrong results with self join + enable_nestloop off  (Etsuro Fujita <etsuro.fujita@gmail.com>)
Список pgsql-hackers

On Fri, Jul 21, 2023 at 8:51 PM Etsuro Fujita <etsuro.fujita@gmail.com> wrote:
I think we should choose the latter, so I modified your patch as
mentioned, after re-creating it on top of my patch.  Attached is a new
version (0002-Allow-join-pushdown-even-if-pseudoconstant-quals-v2.patch).
I am attaching my patch as well
(0001-Disable-join-pushdown-if-pseudoconstant-quals-v2.patch).

Other changes made to your patch:

* I renamed the new member of the ForeignPath struct to
fdw_restrictinfo.  (And I named that of the CustomPath struct
custom_restrictinfo.)
 
That's much better, and more consistent with other members in
ForeignPath/CustomPath.  Thanks!
 
* In your patch, only for create_foreign_join_path(), the API was
modified so that the caller provides the new member of ForeignPath,
but I modified that for
create_foreignscan_path()/create_foreign_upper_path() as well, for
consistency.

LGTM.
 
* In this bit I changed the last argument to NIL, which would be
nitpicking, though.

@@ -1038,7 +1038,7 @@ postgresGetForeignPaths(PlannerInfo *root,
  add_path(baserel, (Path *) path);

  /* Add paths with pathkeys */
- add_paths_with_pathkeys_for_rel(root, baserel, NULL);
+ add_paths_with_pathkeys_for_rel(root, baserel, NULL, NULL);

Good catch!  This was my oversight.
 
* I dropped this test case, because it would not be stable if the
system clock was too slow.

Agreed.  And the test case from 0001 should be sufficient.

So the two patches both look good to me now.

Thanks
Richard

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

Предыдущее
От: Bharath Rupireddy
Дата:
Сообщение: Re: Synchronizing slots from primary to standby
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: pgsql: Allow tailoring of ICU locales with custom rules