Search Postgresql Archives

Re: Improve COPY performance into table with indexes.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 4/3/20 9:52 AM, Adrian Klaver wrote:
On 4/2/20 9:42 PM, James Brauman wrote:
I am using the COPY command to insert 10 million rows from a CSV file
into a database table and I am finding the performance is
unacceptable. When the COPY command is executed the disk I/O is
extremely high which leads to degraded query performance for other
queries being executed on the database.

I have tried removing the indexes from the database table and this
dramatically improved performance (both reducing the execution time
and reducing disk I/O).

I've had excellent results dealing similar data quantity with the earlier suggestion of writing to a staging table.  Simply splitting the insert statements to cover 1/16[1] of the data turned untenable into real-time.

[1] I split on an id column which is of UUID type.  Any arbitrary splitting that reduces the footprint sufficiently will do.






[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux