Postgres insert optimization

前端 未结 7 1629
一个人的身影
一个人的身影 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:54

    If you don't need that kind of functionality in production environment, I'd suggest you turn fsync off from your PostgreSQL config. This will speed up the inserts dramatically.

    Never turn off fsync on a production database.

提交回复
热议问题