Re: partition routing layering in nodeModifyTable.c
Amit Langote <amitlangote09@gmail.com>
From: Amit Langote <amitlangote09@gmail.com>
To: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>,
Daniel Gustafsson <daniel@yesql.se>, Etsuro Fujita <etsuro.fujita@gmail.com>, Andres Freund <andres@anarazel.de>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2020-10-28T07:46:01Z
Lists: pgsql-hackers
Attachments
- v2-0001-Call-BeginDirectModify-from-ExecInitModifyTable.patch (application/octet-stream) patch v2-0001
- v2-0002-Initialize-result-relation-information-lazily.patch (application/octet-stream) patch v2-0002
On Tue, Oct 27, 2020 at 10:23 PM Heikki Linnakangas <hlinnaka@iki.fi> wrote: > This patch looks reasonable to me at a quick glance. I'm a bit worried > or unhappy about the impact on FDWs, though. It doesn't seem nice that > the ResultRelInfo is not available in the BeginDirectModify call. It's > not too bad, the FDW can call ExecGetResultRelation() if it needs it, > but still. Perhaps it would be better to delay calling > BeginDirectModify() until the first modification is performed, to avoid > any initialization overhead there, like establishing the connection in > postgres_fdw. Ah, calling BeginDirectModify() itself lazily sounds like a good idea; see attached updated 0001 to see how that looks. While updating that patch, I realized that the ForeignScan.resultRelation that we introduced in 178f2d560d will now be totally useless. :-( -- Amit Langote EDB: http://www.enterprisedb.com
Commits
-
Fix initialization of es_result_relations in EvalPlanQualStart().
- 22b73d3cb0b5 14.0 landed
-
Remove PartitionRoutingInfo struct.
- fb5883da8615 14.0 landed
-
Revise child-to-root tuple conversion map management.
- 6973533650c0 14.0 landed
-
Clean up code to resolve the "root target relation" in nodeModifyTable.c
- f49b85d783f6 14.0 landed
-
Refactor code for cross-partition updates to a separate function.
- c5b097f8fa69 14.0 landed
-
Remove es_result_relation_info from EState.
- a04daa97a433 14.0 landed
-
Include result relation info in direct modify ForeignScan nodes.
- 178f2d560dde 14.0 landed
-
Create ResultRelInfos later in InitPlan, index them by RT index.
- 1375422c7826 14.0 landed