Re: Performance Problem

From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Performance Problem
Date: 2006-10-13 09:00:57
Message-ID: 20061013090057.GG27503@a-kretschmer.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

am Fri, dem 13.10.2006, um 1:55:06 -0700 mailte Uwe C. Schroeder folgendes:
> > Does the table you're inserting into have indexes or foreign keys?
> > Either of those slow down loading considerably. One commen workaround
> > is to drop the indexes and constraints, load the data and re-add them.
>
> Why do you COPY the data into a temporary table just to do a "insert into
> org_table (select * from temp_table);" ? Since you're copying ALL records
> anyways, why don't you just copy the data into the "org_table" directly?

Perhaps he want to modify the data in this temp. table?

>
> Also look for the "autocommit" setting. If autocommit is on, every insert is a
> transaction on it's own - leading to a lot of overhead. Turning autocommit
> off and running the inserts in batches of - say 1000 inserts per transaction
> - will increase speed considerably.

A 'insert into org_table (select * from temp_table);' is only ONE
transaction.

Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47215, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net

In response to

Browse pgsql-general by date

  From Date Subject
Next Message jef peeraer 2006-10-13 09:14:53 encoding problem
Previous Message Uwe C. Schroeder 2006-10-13 08:55:06 Re: Performance Problem