Re: postgres_fdw: wrong results with self join + enable_nestloop off
Richard Guo <guofenglinux@gmail.com>
From: Richard Guo <guofenglinux@gmail.com>
To: Etsuro Fujita <etsuro.fujita@gmail.com>
Cc: Nishant Sharma <nishant.sharma@enterprisedb.com>, Suraj Kharage <suraj.kharage@enterprisedb.com>, pgsql-hackers@postgresql.org
Date: 2023-07-24T02:45:44Z
Lists: 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
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Re-allow FDWs and custom scan providers to replace joins with pseudoconstant quals.
- 9e9931d2bf40 17.0 landed
-
Disallow replacing joins with scans in problematic cases.
- db01f26968f2 11.21 landed
- 9edf72aa7644 12.16 landed
- 730f983effa5 13.12 landed
- b0e390e6d1d6 14.9 landed
- d1ef5631e620 15.4 landed
- 695f5deb7902 16.0 landed
- 6f80a8d9c137 17.0 landed
-
doc: PQinitOpenSSL and PQinitSSL are obsolete in OpenSSL 1.1.0+
- 928e05ddfd40 16.0 cited