pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jan Wieck <JanWieck@Yahoo.com>
To: Beth Gatewood <beth@vizxlabs.com>
Cc: 'Christopher Kings-Lynne' <chriskl@familyhealth.com.au>
Cc: josh@agliodbs.com
Cc: pgsql-sql@postgresql.org
Subject: Re: make a unique index for foreign keys?
Date: Thu, 13 Jun 2002 12:59:54 -0400
Message-ID: <3D08CF8A.D945FC18@Yahoo.com> (raw)
References: <004701c212f6$ab821900$6501a8c0@bethvizx>

Beth Gatewood wrote:
> 
> Chris/ Josh-
> 
> OK-response to Chris below.  Synopsis here....simply by creating a foreign
> key will not create an index.  On large tables I SHOULD put a non-unique
> index on the foreign key (right?)

    Right, because on DELETE or UPDATE to the primary key, the
    RI triggers have to check that this doesn't leave orphaned
    references or do the required referential action (CASCADE).
    Sometimes this works faster with an index...


Jan

-- 

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #



view thread (8+ messages)  latest in thread

Message-ID: <3D08CF8A.D945FC18@Yahoo.com>
Permalink:  ../3D08CF8A.D945FC18@Yahoo.com/
Also on:    postgresql.org/message-id/3D08CF8A.D945FC18@Yahoo.com

 · 

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: JanWieck@Yahoo.com, beth@vizxlabs.com, chriskl@familyhealth.com.au, josh@agliodbs.com
  Subject: Re: make a unique index for foreign keys?
  In-Reply-To: <3D08CF8A.D945FC18@Yahoo.com>

* 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