Update and foreign key indices

From: "Nikhil G(dot) Daddikar" <ngd(at)celoxis(dot)com>
To: "pggeneral" <pgsql-general(at)postgresql(dot)org>
Subject: Update and foreign key indices
Date: 2002-08-05 12:36:33
Message-ID: 004301c23c7c$f0089220$2c00a8c0@darkstar
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello Folks,

I will ask my question through an example:

1) I have table PROJECT that has a foreign key USER_ID references USER(ID)

2) I *don't* use USER_ID in a where clause so don't have to create indices for performance reason.

3) USER table's primary key *never* changes.

Q: Do I have to create an index for FK USER_ID to speed up updates to USER table rows?

Basically, is PG nice enough to understand that since a key is not updated, it need not check the integrity constraints.

I am using PGSQL 7.1.3

Thanks.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Christian Ullrich 2002-08-05 12:39:35 Julian day calculation is wrong (strictly speaking)
Previous Message Valerie Schneider DSI/DEV 2002-08-05 12:24:26 Memory usage / concept