Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 4C9799F9A60 for ; Sun, 2 Sep 2007 18:12:13 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 03811-07 for ; Sun, 2 Sep 2007 18:12:04 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from bay0-omc2-s28.bay0.hotmail.com (bay0-omc2-s28.bay0.hotmail.com [65.54.246.164]) by postgresql.org (Postfix) with ESMTP id 4E6729F95DB for ; Sun, 2 Sep 2007 18:12:07 -0300 (ADT) Received: from BAY120-W14 ([207.46.9.177]) by bay0-omc2-s28.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2668); Sun, 2 Sep 2007 14:12:05 -0700 Message-ID: Content-Type: multipart/alternative; boundary="_d53c4689-0030-4549-92ee-ee11cc55ee86_" X-Originating-IP: [24.71.223.153] From: L D To: Subject: PK & FK & Index Question Date: Sun, 2 Sep 2007 19:12:06 -0200 Importance: Normal MIME-Version: 1.0 X-OriginalArrivalTime: 02 Sep 2007 21:12:05.0943 (UTC) FILETIME=[EA49A470:01C7EDA5] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.221 tagged_above=0 required=5 tests=BAYES_20=-0.74, HTML_MESSAGE=0.001, RCVD_IN_BL_SPAMCOP_NET=1.96 X-Spam-Level: * X-Archive-Number: 200709/5 X-Sequence-Number: 29218 --_d53c4689-0030-4549-92ee-ee11cc55ee86_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi All, =20 Assume the following have a one-to-one relationship: =20 team_contact team_contact_id (PK) first_name last_name ... =20 team_contact_contacts team_contact_id (FK) home_phone work_phone ... =20 =20 Should I set the latter table's FK also to PK? If so, do I need to set an = index on the FK even though it's also the primary key? =20 Alternatively, I could just add a UK contraint to FK and do away with PK, r= ight? =20 Thanks. =20 --Lenard =20 =20 =20 =20 _________________________________________________________________ Connect to the next generation of MSN Messenger=A0 http://imagine-msn.com/messenger/launch80/default.aspx?locale=3Den-us&sourc= e=3Dwlmailtagline= --_d53c4689-0030-4549-92ee-ee11cc55ee86_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi All,
 
Assume the following have a one-to-one relationship:
 
team_contact
     team_contact_id  (PK)
     first_name
     last_name      ...
 
team_contact_contacts
     team_contact_id  (FK)
     home_phone
     work_phone<= BR>      ...
 
 
Should I set the latter table's FK also to PK?  If so, do I need = to set an index on the FK even though it's also the primary key?
 
Alternatively, I could just add a UK contraint to FK and do away with = PK, right?
 
Thanks.
 
--Lenard   
 
 
 


Connect to the next generation of MSN Messenger=A0 <= a href=3D'http://imagine-msn.com/messenger/launch80/default.aspx?locale=3De= n-us&source=3Dwlmailtagline' target=3D'_new'>Get it now! = --_d53c4689-0030-4549-92ee-ee11cc55ee86_--