Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 3870047593E for ; Thu, 13 Jun 2002 13:08:51 -0400 (EDT) Received: from smtp014.mail.yahoo.com (smtp014.mail.yahoo.com [216.136.173.58]) by postgresql.org (Postfix) with SMTP id 0C8264758F1 for ; Thu, 13 Jun 2002 13:08:50 -0400 (EDT) Received: from unknown (HELO saturn.janwieck.net) (janwieck@192.233.92.205 with login) by smtp.mail.vip.sc5.yahoo.com with SMTP; 13 Jun 2002 17:08:48 -0000 Received: from Yahoo.com (saturn [127.0.0.1]) by saturn.janwieck.net (8.11.2/8.11.2) with ESMTP id g5DGxsI11295; Thu, 13 Jun 2002 12:59:54 -0400 Message-ID: <3D08CF8A.D945FC18@Yahoo.com> Date: Thu, 13 Jun 2002 12:59:54 -0400 From: Jan Wieck X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.4.12 i686) X-Accept-Language: en MIME-Version: 1.0 To: Beth Gatewood Cc: "'Christopher Kings-Lynne'" , josh@agliodbs.com, pgsql-sql@postgresql.org Subject: Re: make a unique index for foreign keys? References: <004701c212f6$ab821900$6501a8c0@bethvizx> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200206/180 X-Sequence-Number: 8145 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 #