Re: Performance Problem - Mailing list pgsql-general

From A. Kretschmer
Subject Re: Performance Problem
Date
Msg-id 20061013090057.GG27503@a-kretschmer.de
Whole thread Raw
In response to Re: Performance Problem  ("Uwe C. Schroeder" <uwe@oss4u.com>)
List 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

pgsql-general by date:

Previous
From: "Uwe C. Schroeder"
Date:
Subject: Re: Performance Problem
Next
From: jef peeraer
Date:
Subject: encoding problem