pg.ddx.io pgsql-performance@postgresql.org mailing list archivehelp / color / mirror / Atom feed
From: Mark Lewis <mark.lewis@mir3.com>
To: Merlin Moncure <mmoncure@gmail.com>
Cc: Scott Marlowe <smarlowe@g2switchworks.com>
Cc: Karen Hill <karen_hill22@yahoo.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: How long should it take to insert 200,000 records?
Date: Tue, 06 Feb 2007 10:31:26 -0800
Message-ID: <1170786686.16656.484.camel@archimedes> (raw)
In-Reply-To: <b42b73150702060901n7291a644xe496ed93962ed9f6@mail.gmail.com>
References: <1170722158.973141.208230@j27g2000cwj.googlegroups.com>
<1170778484.5451.97.camel@state.g2switchworks.com>
<b42b73150702060840y5594ca57mace48fdbdb21fb78@mail.gmail.com>
<1170780953.5451.99.camel@state.g2switchworks.com>
<b42b73150702060901n7291a644xe496ed93962ed9f6@mail.gmail.com>
On Tue, 2007-02-06 at 12:01 -0500, Merlin Moncure wrote:
> On 2/6/07, Scott Marlowe <smarlowe@g2switchworks.com> wrote:
> > On Tue, 2007-02-06 at 10:40, Merlin Moncure wrote:
> > > On 2/6/07, Scott Marlowe <smarlowe@g2switchworks.com> wrote:
> > > > On Mon, 2007-02-05 at 18:35, Karen Hill wrote:
> > > > > I have a pl/pgsql function that is inserting 200,000 records for
> > > > > testing purposes. What is the expected time frame for this operation
> > > > > on a pc with 1/2 a gig of ram and a 7200 RPM disk? The processor is
> > > > > a 2ghz cpu. So far I've been sitting here for about 2 million ms
> > > > > waiting for it to complete, and I'm not sure how many inserts postgres
> > > > > is doing per second.
> > > >
> > > > That really depends. Doing 200,000 inserts as individual transactions
> > > > will be fairly slow. Since PostgreSQL generally runs in autocommit
> > > > mode, this means that if you didn't expressly begin a transaction, you
> > > > are in fact inserting each row as a transaction. i.e. this:
> > >
> > > I think OP is doing insertion inside a pl/pgsql loop...transaction is
> > > implied here.
> >
> > Yeah, I noticed that about 10 seconds after hitting send... :)
>
> actually, I get the stupid award also because RI check to unindexed
> column is not possible :) (this haunts deletes, not inserts).
Sure it's possible:
CREATE TABLE parent (col1 int4);
-- insert many millions of rows into parent
CREATE TABLE child (col1 int4 REFERENCES parent(col1));
-- insert many millions of rows into child, very very slowly.
- Mark Lewis
view thread (16+ messages) latest in thread
Message-ID: <1170786686.16656.484.camel@archimedes> Permalink: ../1170786686.16656.484.camel@archimedes/ Also on: postgresql.org/message-id/1170786686.16656.484.camel@archimedes ·
reply
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: mark.lewis@mir3.com, mmoncure@gmail.com, smarlowe@g2switchworks.com, karen_hill22@yahoo.com Subject: Re: How long should it take to insert 200,000 records? In-Reply-To: <1170786686.16656.484.camel@archimedes> * 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