Re: insert

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Matt Clark <matt(at)ymogen(dot)net>
Cc: 'Rod Taylor' <pg(at)rbt(dot)ca>, 'Ulrich Wisser' <ulrich(dot)wisser(at)relevanttraffic(dot)se>, 'gnari' <gnari(at)simnet(dot)is>, 'Postgresql Performance' <pgsql-performance(at)postgresql(dot)org>
Subject: Re: insert
Date: 2004-08-13 16:31:34
Message-ID: 20040813163134.GA3743@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Fri, Aug 13, 2004 at 17:17:10 +0100,
Matt Clark <matt(at)ymogen(dot)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.

In response to

  • Re: insert at 2004-08-13 16:17:10 from Matt Clark

Browse pgsql-performance by date

  From Date Subject
Next Message Josh Berkus 2004-08-13 17:19:15 Re: [PERFORM] Performance Problem With Postgresql!
Previous Message Matt Clark 2004-08-13 16:17:10 Re: insert