RE: POC: postgres_fdw insert batching

From: "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>
To: Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, 'Zhihong Yu' <zyu(at)yugabyte(dot)com>
Cc: Amit Langote <amitlangote09(at)gmail(dot)com>, "Andrey V(dot) Lepikhov" <a(dot)lepikhov(at)postgrespro(dot)ru>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: RE: POC: postgres_fdw insert batching
Date: 2021-01-19 01:56:50
Message-ID: TYAPR01MB299078E548D696A3D5CD197AFEA30@TYAPR01MB2990.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tomas-san, Zhihong-san,

From: Zhihong Yu <zyu(at)yugabyte(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2021-01-19 01:57:05 Re: PoC/WIP: Extended statistics on expressions
Previous Message Michael Paquier 2021-01-19 01:52:46 Paint some PG_USED_FOR_ASSERTS_ONLY in inline functions of ilist.h and bufpage.h