I am currently running tests on how fast can JDBC with PostgreSQL insert bulk inserts.
It seems that there is an optimal number of inserts one bulk insert should be doing and it is not very high (about 200). I call it the optimal number, since inserting more (or less) takes more time to insert a million of rows.
Why is that the case and can I increase that optimal number?
If you are interested of how my test works:
I am creating a million of events that should be inserted into the table. I set a maximal bulk size to 1, let the program insert and measure the time as the number of events to insert hits 0. I then repeat this with a maximal bulk size of one more.