I have data with amount of 2 millions needed to insert into postgresql. But it has played an low performance. Can I achieve a high-performance inserter by split the large transaction into smaller ones (Actually, I don't want to do this)? or, there is any other wise solutions?
Possible methods to improve performance:
COPY
command.isolation level
for the transaction if your data can deal with the consequences.nobarrier
flag for the ext4
file system) and/or fsync
on the PostgreSQL server. Warning: this is usually unsafe but will improve your performance a lot.Splitting the insert job into series of smaller transaction will help only if you have to retry the transaction because of data dependency issues with paraller transactions. If the transaction succeeds on the first try, splitting it into several smaller transactions run in sequence will only decrease your performance.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With