Re: Bulk Insert into PostgreSQL

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: Srinivas Karthik V <skarthikv(dot)iitb(at)gmail(dot)com>
Cc: Don Seiler <don(at)seiler(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Subject: Re: Bulk Insert into PostgreSQL
Date: 2018-06-30 13:26:50
Message-ID: CAMsr+YFH=HVr5_q4Hqt4YPJyjGAmqsD8aDqTwqBF58CtT6HHOw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 30 June 2018 at 06:47, Srinivas Karthik V <skarthikv(dot)iitb(at)gmail(dot)com>
wrote:

> I was using copy command to load. Removing the primary key constraint on
> the table and then loading it helps a lot. In fact, a 400GB table was
> loaded and the primary constraint was added in around 15 hours. Thanks for
> the wonderful suggestions.
>
>
You can also gain a bit by running with wal_level = minimal. On newer
version you can use UNLOGGED tables then convert them to logged, but that
won't be an option for 9.4.

--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2018-06-30 13:50:15 Re: Concurrency bug in UPDATE of partition-key
Previous Message Tom Lane 2018-06-30 05:19:49 Re: pgsql: Fix crash when ALTER TABLE recreates indexes on partitions