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>, 'Zhihong Yu' <zyu@yugabyte.com>
Cc: Amit Langote <amitlangote09@gmail.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-19T01:56:50Z
Lists: pgsql-hackers
Tomas-san, Zhihong-san,
From: Zhihong Yu <zyu@yugabyte.com>
> + if (batch_size <= 0)
> + ereport(ERROR,
> + (errcode(ERRCODE_SYNTAX_ERROR),
> + errmsg("%s requires a non-negative integer value",
>
> It seems the message doesn't match the check w.r.t. the batch size of 0.
Ah, "non-negative" should be "positive". The message for the existing fetch_size should be fixed too. Tomas-san, could you include this as well? I'm sorry to trouble you.
> + int numInserted = numSlots;
>
> Since numInserted is filled by ExecForeignBatchInsert(), the initialization can be done with 0.
No, the code is correct, since the batch function requires the number of rows to insert as input.
Regards
Takayuki Tsunakawa
Commits
-
Fix tuple routing to initialize batching only for inserts
- 927f453a9410 14.0 landed
-
Fix pointer type in ExecForeignBatchInsert SGML docs
- c15283ff429b 14.0 landed
-
Fix initialization of FDW batching in ExecInitModifyTable
- 920f853dc948 14.0 landed
-
Implement support for bulk inserts in postgres_fdw
- b663a4136331 14.0 landed