Postgres cost of large volume of inserts in many tables in a single transaction
You have it backwards - it is generally better to do many rows in a single transaction than one at a time with autocommit. The reasons are a) disk I/O and b) network round trips between client and server. You will need to run benchmarks to find the ideal batch size for your data and your hardware - try 100, 1000, 10000 sized transactions and see. At some point it will peak and past that the transactions will be "too big" as you bump into some other limit.