Re: Expression errors with "FOR UPDATE" and postgres_fdw with partition wise join enabled.
Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>
From: Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>,
Rajkumar Raghuwanshi <rajkumar.raghuwanshi@enterprisedb.com>,
pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2018-07-02T09:46:35Z
Lists: pgsql-hackers
(2018/06/22 23:58), Robert Haas wrote: > I think this approach is going to run into trouble if the level at > which we have to apply the ConvertRowTypeExpr happens not to be a > projection-capable node. Actually, the level we have to do that would be a child rel of a partitioned table or a child join of a partitionwise join, so the plan node would be a scan or join plan unless the child rel or child join is itself partitioned, in which case the plan node would be Append/MergeAppend and the proposed patch recursively would apply that conversion to child plans for the Append/MergeAppend). > And, in general, it seems to me that we want > to produce the right outputs at the lowest possible level of the plan > tree. For instance, suppose that one of the relations being scanned > is not parallel-safe but the others are. Then, we could end up with a > plan like this: > > Append > -> Seq Scan on temp_rela > -> Gather > -> Parallel Seq Scan on thing1 > -> Gather > -> Parallel Seq Scan on thing2 > > If a projection is required to convert the row type expression, we > certainly want that to get pushed below the Gather, not to happen at > the Gather level itself. IIUC, we currently don't consider such a plan for partition-wise join; we'll only consider gathering partial paths for the parent appendrel. So, I'm not sure we need to take into account that when applying the ConvertRowtypeExpr. Maybe I'm missing something, though. > We certainly don't want it to happen at the > Append level, which can't even handle it. I think so too. Best regards, Etsuro Fujita
Commits
-
Adjust EXPLAIN's output for disabled nodes
- 161320b4b960 18.0 cited
-
Disable support for partitionwise joins in problematic cases.
- 940487956ede 11.0 landed
- 7cfdc77023ad 12.0 landed
-
Rewrite the code that applies scan/join targets to paths.
- 11cf92f6e2e1 11.0 cited