Re: Postgres batch write very slow - what to do
От | Heikki Linnakangas |
---|---|
Тема | Re: Postgres batch write very slow - what to do |
Дата | |
Msg-id | 45F685B7.5040001@enterprisedb.com обсуждение исходный текст |
Ответ на | Postgres batch write very slow - what to do (femski <hypertree@yahoo.com>) |
Ответы |
Re: Postgres batch write very slow - what to do
|
Список | pgsql-performance |
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
В списке pgsql-performance по дате отправления: