Re: Postgres batch write very slow - what to do

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

 



femski wrote:
I have a batch application that writes approx. 4 million rows into a narrow
table. I am using JDBC addBatch/ExecuteBatch with auto commit turned off.
Batch size is 100. So far I am seeing Postgres take roughly five times the
time it takes to do this in the Oracle.

The usual tricks are:
- Drop indexes before loading, and rebuild them afterwards.
- Disable foreign key references while loading
- Use COPY instead of JDBC

Is the loading I/O or CPU bound? How long does the load actually take?

Are you running the latest version of PostgreSQL and the JDBC driver?

Have you read the "Populating a Database" chapter in the manual: http://www.postgresql.org/docs/8.2/interactive/populate.html

--
  Heikki Linnakangas
  EnterpriseDB   http://www.enterprisedb.com


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux