Re: on update / on delete performance of foreign keys

From: Harald Fuchs <hf0722x(at)protecting(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: on update / on delete performance of foreign keys
Date: 2005-01-24 17:48:01
Message-ID: puk6q27m7i.fsf@srv.protecting.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

In article <41F5088D(dot)8060702(at)phlo(dot)org>,
"Florian G. Pflug" <fgp(at)phlo(dot)org> writes:

>> PostgreSQL doesn't automatically add indexes to foreign-key
>> columns. That sounds like the issue to me.

> Oh... *feeling a bit stupid*... Seems that I got confused, because it
> requires an index to exist on the referenced table (To speed up inserts,
> updates), but not on the referencing table...

That's not quite right. What PostgreSQL (or any other DBMS) requires
from the referenced table is a UNIQUE constraint on the column in
question so that the referencing table points to a single row, and
UNIQUE constraints are usually implemented by indices.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2005-01-24 18:01:33 Re: [7.4.1] signal 11 while accesing DB
Previous Message Marcin 2005-01-24 17:45:57 [7.4.1] signal 11 while accesing DB