Re: Primary Keys vs Unique Index
Posted in 2000
You can have one null value in a field which is defined as Unique but you cannot have null in a field which is defined as Primary Vinod Bhansali >From: "Carl Y. Wu" <carlywu2@yahoo.com> >Reply-To: "Carl Y. Wu" <carlywu2@yahoo.com> >To: informix-list@iiug.org >Subject: Re: Primary Keys vs Unique Index >Date: Wed, 31 May 2000 17:40:31 +1000 > >Primary key and Unique index are different concepts although they all >enforce uniqueness. >Primary Key is a "Constraint" which has all features of a contraint. For >example contraint checking is deferred until all triggerred actions are >complete. >In relational database theory "index" is a physical design issue (to >improve >query speed, etc) while primary key is a logical design issue (ideally you >should have a primary key for each table). Informix internally uses indexes >to implement primary keys so you have all advantages of a unique index on >primary keys. >Generally if the column(s) meets the criterias of primary key then a >primary >key is preferred. > >Regards, >Carl Wu > >Gregory P. Schin wrote in message <39344422.419B20BE@lucent.com>... > >Is there any performance or other known problem with using a Primary Key > >with IDS 7.31.UC2A as opposed to a Unique Index? > > > >It seem to me that they do the same exact thing in a slightly different > >manner. > >I have always used Unique Index's -- I am now working on an db that uses > >Primary Keys rather than Unique Indexes. I am tempted to change all the > >Primary Keys to Unique Indexes. Is one of these preferred and why? > > > >Greg > > > > > > ________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com