How to speed up insertion performance in PostgreSQL

后端 未结 7 764
走了就别回头了
走了就别回头了 2020-11-22 06:25

I am testing Postgres insertion performance. I have a table with one column with number as its data type. There is an index on it as well. I filled the database up using thi

7条回答
  •  轮回少年
    2020-11-22 06:57

    I spent around 6 hours on the same issue today. Inserts go at a 'regular' speed (less than 3sec per 100K) up until to 5MI (out of total 30MI) rows and then the performance sinks drastically (all the way down to 1min per 100K).

    I will not list all of the things that did not work and cut straight to the meat.

    I dropped a primary key on the target table (which was a GUID) and my 30MI or rows happily flowed to their destination at a constant speed of less than 3sec per 100K.

提交回复
热议问题