RE: POC: postgres_fdw insert batching

tsunakawa.takay@fujitsu.com <tsunakawa.takay@fujitsu.com>

From: "tsunakawa.takay@fujitsu.com" <tsunakawa.takay@fujitsu.com>
To: 'Tomas Vondra' <tomas.vondra@enterprisedb.com>, Amit Langote <amitlangote09@gmail.com>
Cc: Zhihong Yu <zyu@yugabyte.com>, "Andrey V. Lepikhov" <a.lepikhov@postgrespro.ru>, Tomas Vondra <tomas.vondra@2ndquadrant.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2021-01-21T01:52:48Z
Lists: pgsql-hackers
From: Tomas Vondra <tomas.vondra@enterprisedb.com>
> Right. But I think Tom is right this should initialize ri_BatchSize for all the
> resultRelInfo elements, not just the first one. Per the attached patch, which
> resolves the issue both on x86_64 and armv7l for me.

I think Your patch is perfect in the sense that it's ready for the future multi-target DML support.  +1

Just for learning, could anyone tell me what this loop for?  I thought current Postgres's DML supports a single target table, so it's enough to handle the first element of mtstate->resultRelInfo.  In that sense, Amit-san and I agreed that we don't put the if block in the for loop yet.


Regards
Takayuki Tsunakawa

Commits

  1. Fix tuple routing to initialize batching only for inserts

  2. Fix pointer type in ExecForeignBatchInsert SGML docs

  3. Fix initialization of FDW batching in ExecInitModifyTable

  4. Implement support for bulk inserts in postgres_fdw