Re: Expression errors with "FOR UPDATE" and postgres_fdw with partition wise join enabled.
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>,
Andres Freund <andres@anarazel.de>,
Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>,
Rajkumar Raghuwanshi <rajkumar.raghuwanshi@enterprisedb.com>,
pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2018-07-25T20:42:41Z
Lists: pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes: > On Tue, Jul 24, 2018 at 7:51 AM, Etsuro Fujita > <fujita.etsuro@lab.ntt.co.jp> wrote: >> I'm not sure that's a good idea, because I think we have a trade-off >> relation; the more we make create_plan simple, the more we need to make >> earlier states of the planner complicated. >> >> And it looks to me like the partitionwise join code is making earlier (and >> later) stages of the planner too complicated, to make create_plan simple. > I think that create_plan is *supposed* to be simple. Its purpose is > to prune away data that's only needed during planning and add things > that can be computed at the last minute which are needed at execution > time. Making it do anything else is, in my opinion, not good. I tend to agree with Robert on this. In particular, if you put anything into create_plan or later that affects cost estimates, you're really doing it wrong, because changing those estimates might've changed the plan entirely. (As I recall, we have a couple of cheats like that now, associated with dropping no-op projection and subquery scan nodes. But let's not add more.) TBH, I think this entire discussion is proving what sheer folly it was to allow partitions to have rowtypes not identical to their parent. But I suppose we're stuck with that now. regards, tom lane
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