Postgresql network transmission overhead

From: "Michael J(dot) Baars" <mjbaars1977(dot)pgsql-hackers(at)cyberfiber(dot)eu>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Postgresql network transmission overhead
Date: 2021-02-24 08:14:19
Message-ID: c7cccd0777f39c53b9514e3824badf276759fa87.camel@cyberfiber.eu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I've written this function to insert several rows at once, and noticed a certain postgresql overhead as you can see from the log file. A lot more data than the
user data is actually sent over the net. This has a certain noticeable impact on the user transmission speed.

I noticed that a libpq query always has a number of arguments of the following form:

Oid paramt[cols] = { 1082, 701, 701, 701, 701, 701, 20, 701 };
int paraml[cols] = { 4, 8, 8, 8, 8, 8, 8, 8 };
int paramf[cols] = { 1, 1, 1, 1, 1, 1, 1, 1 };

result = PQexecParams(psql_cnn, (char* ) &statement, 1, paramt, (const char** ) paramv, paraml, paramf, 1);

I think the 'paramf' is completely redundant. The data mode, text or binary, is already specified in the last argument to 'PQexecParams' and does not have to be
repeated for every value. Am I correct?

Thanks,
Mischa Baars.

Attachment Content-Type Size
PQblockwrite.log text/x-log 3.8 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Nancarrow 2021-02-24 08:44:39 Re: Parallel INSERT (INTO ... SELECT ...)
Previous Message Amit Langote 2021-02-24 08:12:44 Re: [BUG] segfault during delete