Re: How long should it take to insert 200,000 records? - Mailing list pgsql-performance

From Mark Lewis
Subject Re: How long should it take to insert 200,000 records?
Date
Msg-id 1170789053.16656.486.camel@archimedes
Whole thread Raw
In response to Re: How long should it take to insert 200,000 records?  ("Merlin Moncure" <mmoncure@gmail.com>)
List pgsql-performance
On Tue, 2007-02-06 at 14:06 -0500, Merlin Moncure wrote:
> On 2/6/07, Mark Lewis <mark.lewis@mir3.com> wrote:
> > > 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.
>
> the database will not allow you to create a RI link out unless the
> parent table has a primary key/unique constraint, which the database
> backs with an index....and you can't even trick it afterwards by
> dropping the constraint.
>
> it's the other direction, when you cascade forwards when you can have
> a problem.  this is most common with a delete, but can also happen on
> an update of a table's primary key with child tables referencing it.
>

Hmmm, should check my SQL before hitting send I guess.  Well, at least
you no longer have to wear the stupid award, Merlin :)

-- Mark Lewis

pgsql-performance by date:

Previous
From: "Merlin Moncure"
Date:
Subject: Re: How long should it take to insert 200,000 records?
Next
From: Bill Howe
Date:
Subject: Re: index scan through a subquery