From jkanter@virginia.edu Wed Dec 11 19:49:04 2002 Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id CBA4F476C19 for ; Wed, 11 Dec 2002 14:49:04 -0500 (EST) Received: from mail.virginia.edu (mail.Virginia.EDU [128.143.2.9]) by postgresql.org (Postfix) with SMTP id B3466476CB7 for ; Wed, 11 Dec 2002 14:48:34 -0500 (EST) Received: from smtp.mail.virginia.edu by mail.virginia.edu id aa09773; 11 Dec 2002 14:47 EST Received: from jlk3xpc (d-128-19-222.bootp.Virginia.EDU [128.143.19.222]) by smtp.mail.Virginia.EDU (8.11.6/8.11.6) with SMTP id gBBJllN25476 for ; Wed, 11 Dec 2002 14:47:48 -0500 Message-ID: <010301c2a14e$af1f4ba0$de138f80@virginia.edu> From: Jodi Kanter To: Postgres Admin List Subject: PKs for dictionary tables Date: Wed, 11 Dec 2002 14:51:23 -0500 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0100_01C2A124.C62A9810" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200212/156 X-Sequence-Number: 6651 This is a multi-part message in MIME format. ------=_NextPart_000_0100_01C2A124.C62A9810 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I have a database in which there is a particular data tables that has a lot= of dictionary (or lookup) tables hanging off of it. The dictionary tables = do not currently have PKs. They consist merely of a list of values that are= used to create drop down lists in an application. Would it be more efficient to create PKs for these dictionary tables so tha= t an integer value is stored in the main data table as opposed to a sting v= alue? Is there a preferred database standard? Thanks Jodi _______________________________ Jodi L Kanter BioInformatics Database Administrator University of Virginia (434) 924-2846 jkanter@virginia.edu =20 =20 =20 ------=_NextPart_000_0100_01C2A124.C62A9810 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
I have a database in which there is a= =20 particular data tables that has a lot of dictionary (or lookup) tables hang= ing=20 off of it. The dictionary tables do not currently have PKs. They consist me= rely=20 of a list of values that are used to create drop down lists in an=20 application.
 
Would it be more efficient to create PK= s for=20 these dictionary tables so that an integer value is stored in the main data= =20 table as opposed to a sting value?
Is there a preferred database=20 standard?
 
Thanks
Jodi

_______________________________
Jodi=20 L Kanter
BioInformatics Database Administrator
University of=20 Virginia
(434) 924-2846
jkanter@virginia.edu

 

 

 

<= /DIV> ------=_NextPart_000_0100_01C2A124.C62A9810-- From nickf@ontko.com Wed Dec 11 20:09:13 2002 Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 27491476CEB for ; Wed, 11 Dec 2002 15:09:13 -0500 (EST) Received: from shire.ontko.com (shire.ontko.com [199.164.165.1]) by postgresql.org (Postfix) with ESMTP id D34A3476CD7 for ; Wed, 11 Dec 2002 15:07:16 -0500 (EST) Received: from nick (bilbo.ontko.com [199.164.165.101]) by shire.ontko.com (8.12.6/8.12.6/Debian-6Woody) with SMTP id gBBK7Hpq007356; Wed, 11 Dec 2002 15:07:17 -0500 Reply-To: From: "Nick Fankhauser" To: "Jodi Kanter" , "Postgres Admin List" Subject: Re: PKs for dictionary tables Date: Wed, 11 Dec 2002 15:03:19 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 In-Reply-To: <010301c2a14e$af1f4ba0$de138f80@virginia.edu> X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200212/158 X-Sequence-Number: 6653 The preferred method is to have a PK and store it in your big table. In addition to being more "normal" and probably saving a little space, this gives you the option of changing the corresponding values in one place. So for instance if your lookup table was "datatypes", and you had entered "Sting" at first, after several thousand records had been created that referred to this in the main table, you would be able to correct your spelling for all of them by changing a single field in the lookup table... -Nick -----Original Message----- From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org]On Behalf Of Jodi Kanter Sent: Wednesday, December 11, 2002 2:51 PM To: Postgres Admin List Subject: [ADMIN] PKs for dictionary tables I have a database in which there is a particular data tables that has a lot of dictionary (or lookup) tables hanging off of it. The dictionary tables do not currently have PKs. They consist merely of a list of values that are used to create drop down lists in an application. Would it be more efficient to create PKs for these dictionary tables so that an integer value is stored in the main data table as opposed to a sting value? Is there a preferred database standard? Thanks Jodi _______________________________ Jodi L Kanter BioInformatics Database Administrator University of Virginia (434) 924-2846 jkanter@virginia.edu