Re: [HACKERS] Insert values() per-statement overhead - Mailing list pgsql-hackers

From Vladimir Sitnikov
Subject Re: [HACKERS] Insert values() per-statement overhead
Date
Msg-id CAB=Je-Gps4Kiu-2tXqAHSrtt4mAU6PQaC0E1ocVmgVHrieGYYQ@mail.gmail.com
Whole thread Raw
In response to Re: Insert values() per-statement overhead  (Vladimir Sitnikov <sitnikov.vladimir@gmail.com>)
List pgsql-hackers
Andres>I think the biggestoverhead here is that the executor startup includes
Andres>too many indirect (linked lists) datastructured, that allocated each
Andres>round

The case is very common: batch inserts are popular in Java, and ORMs use batch API automatically.
However, there's high per-backend-message overhead, and that overhead is very noticeable.

What is the approach to handle this?

Folding multiple DML statements into one with a help of CTE does not work either (see https://github.com/pgjdbc/pgjdbc/issues/1165 ):

CTE doc>Trying to update the same row twice in a single statement is not supported. Only one of the modifications takes place, but it is not easy (and sometimes not possible) to reliably predict which one

Vladimir

pgsql-hackers by date:

Previous
From: Gavin Flower
Date:
Subject: Re: bulk typos
Next
From: David Fetter
Date:
Subject: Re: Diagonal storage model