pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Merlin Moncure <mmoncure@gmail.com>
To: Mark Lewis <mark.lewis@mir3.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, 6 Feb 2007 14:06:32 -0500
Message-ID: <b42b73150702061106r7ed1d643k84e44f051dd68aaa@mail.gmail.com> (raw)
In-Reply-To: <1170786686.16656.484.camel@archimedes>
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>
	<1170786686.16656.484.camel@archimedes>

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.

merlin



view thread (16+ messages)  latest in thread

Message-ID: <b42b73150702061106r7ed1d643k84e44f051dd68aaa@mail.gmail.com>
Permalink:  ../b42b73150702061106r7ed1d643k84e44f051dd68aaa@mail.gmail.com/
Also on:    postgresql.org/message-id/b42b73150702061106r7ed1d643k84e44f051dd68aaa@mail.gmail.com

 · 

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: mmoncure@gmail.com, mark.lewis@mir3.com, smarlowe@g2switchworks.com, karen_hill22@yahoo.com
  Subject: Re: How long should it take to insert 200,000 records?
  In-Reply-To: <b42b73150702061106r7ed1d643k84e44f051dd68aaa@mail.gmail.com>

* 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