pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Hall <andrewah@hotmail.com>
To: PostgreSQL Mailing List <pgsql-sql@postgresql.org>
Subject: Foreign key - Indexing & Deadlocking.
Date: Tue, 29 Dec 2009 22:59:06 +0000
Message-ID: <COL122-W493DEB26AA345A7DCE0058CD7A0@phx.gbl> (raw)


Hi,

I'm porting some Oracle software to PostgreSQL, & have a question about best practices with foreign keys.

In the Oracle environment, you're basically obliged to index all foreign keys (more specifically foreign key columns should appear on the leading edge of an index) due to the way that it manages locks. 

Failure to index foreign keys in this way in Oracle often causes deadlock situations.

Although I could no find a mention of anything similar in the postgreSQL documentation, I just wanted to check whether or not the same was true of PostgreSQL to be on the safe side.

Thanks,

Andrew.
 		 	   		  
_________________________________________________________________
Use Hotmail to send and receive mail from your different email accounts
http://clk.atdmt.com/UKM/go/186394592/direct/01/=

view thread (2+ messages)  latest in thread

Message-ID: <COL122-W493DEB26AA345A7DCE0058CD7A0@phx.gbl>
Permalink:  ../COL122-W493DEB26AA345A7DCE0058CD7A0@phx.gbl/
Also on:    postgresql.org/message-id/COL122-W493DEB26AA345A7DCE0058CD7A0@phx.gbl

 · 

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-sql@postgresql.org
  Cc: andrewah@hotmail.com
  Subject: Re: Foreign key - Indexing & Deadlocking.
  In-Reply-To: <COL122-W493DEB26AA345A7DCE0058CD7A0@phx.gbl>

* 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