Re: postgres_fdw: wrong results with self join + enable_nestloop off
Richard Guo <guofenglinux@gmail.com>
From: Richard Guo <guofenglinux@gmail.com>
To: Nishant Sharma <nishant.sharma@enterprisedb.com>
Cc: Suraj Kharage <suraj.kharage@enterprisedb.com>,
Etsuro Fujita <etsuro.fujita@gmail.com>, pgsql-hackers@postgresql.org
Date: 2023-06-05T03:09:12Z
Lists: pgsql-hackers
On Fri, Jun 2, 2023 at 8:31 PM Nishant Sharma <
nishant.sharma@enterprisedb.com> wrote:
> *I only had a minor comment on below change:-*
>
>
>
>
>
> *- gating_clauses = get_gating_quals(root, scan_clauses);+ if
> (best_path->pathtype == T_ForeignScan && IS_JOIN_REL(rel))+
> gating_clauses = get_gating_quals(root, ((ForeignPath *)
> best_path)->joinrestrictinfo);+ else+ gating_clauses =
> get_gating_quals(root, scan_clauses);*
>
> Instead of using 'if' and creating a special case here can't we do
> something in the above switch?
>
I thought about that too. IIRC I did not do it in that way because
postgresGetForeignPlan expects that there is no scan_clauses for a join
rel. So doing that would trigger the Assert there.
/*
* For a join rel, baserestrictinfo is NIL and we are not considering
* parameterization right now, so there should be no scan_clauses for
* a joinrel or an upper rel either.
*/
Assert(!scan_clauses);
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