Quote Originally Posted by PAVB
I would try to commit more often, inside your loop -start by commiting every 10 rows inserted and then test making insert batch larger until you are comfortable.
I think it is very unlikely that committing more or less often is going to change anything.

You should try using hash partitioning with a lot of partitions. this will make more of a random distribution of values across a larger number of partitions, so it is unlikely that one part of the primary key is going to raise a locking issue.

You should also make sure that the table allows parallel transactions, and verify that this isn't a trigger causing the locking issue.