Re: insert - Mailing list pgsql-performance

From Bruno Wolff III
Subject Re: insert
Date
Msg-id 20040813163134.GA3743@wolff.to
Whole thread Raw
In response to Re: insert  (Bruno Wolff III <bruno@wolff.to>)
List pgsql-performance
On Fri, Aug 13, 2004 at 17:17:10 +0100,
  Matt Clark <matt@ymogen.net> wrote:
> > > It is likely that you are missing an index on one of those foreign
> > > key'd items.
> >
> > I don't think that is too likely as a foreign key reference
> > must be a unique key which would have an index.
>
> I think you must be thinking of primary keys, not foreign keys.  All
> one-to-many relationships have non-unique foreign keys.

The target of the reference needs to have at least a unique index.
I am not sure if it needs to actually be declared as either a unique
or primary key, though that is the intention.

The records doing the referencing don't need (and normally aren't)
unique.

pgsql-performance by date:

Previous
From: Richard Huxton
Date:
Subject: Re: Weird Database Performance problem!
Next
From: "Matt Clark"
Date:
Subject: Re: insert