From: A. Kretschmer <andreas.kretschmer@schollglas.com>
To: pgsql-general@postgresql.org
Subject: Re: Performance Problem
Date: Fri, 13 Oct 2006 11:00:57 +0200
Message-ID: <20061013090057.GG27503@a-kretschmer.de> (raw)
In-Reply-To: <200610130155.06831.uwe@oss4u.com>
References: <20061013052628.7600.qmail@web50802.mail.yahoo.com>
<20061013082210.GE1896@svana.org>
<200610130155.06831.uwe@oss4u.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: andreas.kretschmer@schollglas.com
Subject: Re: Performance Problem
In-Reply-To: <20061013090057.GG27503@a-kretschmer.de>
References: <20061013052628.7600.qmail@web50802.mail.yahoo.com> <20061013082210.GE1896@svana.org> <200610130155.06831.uwe@oss4u.com> <20061013090057.GG27503@a-kretschmer.de>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox