Postgres insert optimization

前端 未结 7 1631
一个人的身影
一个人的身影 2021-02-04 18:25

I have a script that generates tens of thousands of inserts into a postgres db through a custom ORM. As you can imagine, it\'s quite slow. This is used for development purpose

7条回答
  •  余生分开走
    2021-02-04 18:51

    Are you sending a batch of tens of thousands of INSERTs OR are you sending tens of thousands of INSERTs?

    I know with Hibernate you can batch all your SQL statements up and send them at the end in one big chunk instead of taking the tax of network and database overhead of making thousands of SQL statements individually.

提交回复
热议问题