Re: Bulk load data from one table to another

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Nikola <XLPizza(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Bulk load data from one table to another
Date: 2008-06-24 14:11:29
Message-ID: 15823.1214316689@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Nikola <XLPizza(at)gmail(dot)com> writes:
> Currently, I truncate the destination table, drop the indexes,
> execute:
> "INSERT INTO destination SELECT * FROM source_partition"
> and recreate indexes.

> This loads about 66.5 million rows into the destination table in about
> 1 hour. Recreating of indexes (4 of them) takes additional 2 hours. Is
> there a more efficient way to perform this procedure?

Do you have maintenance_work_mem set to a suitable value for building
the indexes?

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Brandon Metcalf 2008-06-24 14:14:20 backslashes in 8.3.3
Previous Message Ludwig Kniprath 2008-06-24 13:46:55 Re: Query