Re: postgres_fdw: wrong results with self join + enable_nestloop off
Önder Kalacı <onderkalaci@gmail.com>
From: Önder Kalacı <onderkalaci@gmail.com>
To: Etsuro Fujita <etsuro.fujita@gmail.com>
Cc: Richard Guo <guofenglinux@gmail.com>, Nishant Sharma <nishant.sharma@enterprisedb.com>, Suraj Kharage <suraj.kharage@enterprisedb.com>, pgsql-hackers@postgresql.org
Date: 2023-08-16T13:58:29Z
Lists: pgsql-hackers
Hi Etsuro, Thanks for the response! > Maybe we could do so by leaving to extensions the decision whether > they replace joins with pseudoconstant clauses, but I am not sure that > that is a good idea, because that would require the authors to modify > and recompile their extensions to fix the issue... I think I cannot easily follow this argument. The decision to push down the join (or not) doesn't seem to be related to calling set_join_pathlist_hook. It seems like the extension should decide what to do with the hook. That seems the generic theme of the hooks that Postgres provides. For example, the extension is allowed to even override the whole planner/executor, and there is no condition that would prevent it from happening. In other words, an extension can easily return wrong results with the wrong actions taken with the hooks, and that should be responsibility of the extension, not Postgres > I am not familiar with the Citus extension, but such pseudoconstant > clauses are handled within the Citus extension? > > As I noted earlier, Citus relies on this hook for collecting information about all the joins that Postgres knows about, there is nothing specific to pseudoconstants. Some parts of creating the (distributed) plan relies on the information gathered from this hook. So, if information about some of the joins are not passed to the extension, then the decisions that the extension gives are broken (and as a result the queries are broken). Thanks, Onder
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