From: Kevin Brown <kevin@sysexperts.com>
To: pgsql-hackers@postgresql.org
Subject: Re: COPY from question
Date: Tue, 3 Feb 2004 02:57:46 -0800
Message-ID: <20040203105746.GE2608@filer> (raw)
In-Reply-To: <Pine.GSO.4.10.10402031143460.19878-100000@bruce.csse.monash.edu.au>
References: <1070584326.18838.235.camel@cletus.lyris.com>
<Pine.GSO.4.10.10402031143460.19878-100000@bruce.csse.monash.edu.au>
Slavisa Garic wrote:
> Using pg module in python I am trying to run the COPY command to populate
> the large table. I am using this to replace the INSERT which takes about
> few hours to add 70000 entries where copy takes minute and a half.
That difference in speed seems quite large. Too large. Are you batching
your INSERTs into transactions (you should be in order to get good
performance)? Do you have a ton of indexes on the table? Does it have
triggers on it or some other thing (if so then COPY may well wind up doing
the wrong thing since the triggers won't fire for the rows it inserts)?
I don't know what kind of schema you're using, but it takes perhaps a
couple of hours to insert 2.5 million rows on my system. But the rows
in my schema may be much smaller than yours.
--
Kevin Brown kevin@sysexperts.com
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 using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: kevin@sysexperts.com, pgsql-hackers@postgresql.org
Subject: Re: COPY from question
In-Reply-To: <20040203105746.GE2608@filer>
* 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