RE: primary and unique index
Posted in 1999
On the other hand you loose control of the index by letting the primary key create it own index. You can create your unique index prior to creating your primary constraint and detach or locate the index in another dbspace even name it. Then when you create the primary key it will use the index you have already created. This give you control of the index. If the table is small, it does not matter. William Raper <WilliamR@catmktg.com> on 09/29/99 02:10:07 PM To: "'samir BADAOUI'" <samir_badaoui@hotmail.com>, informix-list@iiug.org cc: (bcc: Kernoal Stephens/STS/AUTOZONE) Subject: RE: primary and unique index Informix Guide to SQL Syntax Page 2-44: n When you place a primary-key or unique constraint on a column or set of columns, and a unique index already exists on that column or set of columns, the constraint shares the index. However, if the existing index allows duplicates, the database server returns an error. You must then drop the existing index before you add the constraint. So, in essence it is 6 of the 1, and half-a-dozen of the other. My recommendation would be to drop the unique index to make the database schema less confusing. > -----Original Message----- > From: samir BADAOUI [SMTP:samir_badaoui@hotmail.com] > Sent: Wednesday, September 29, 1999 11:26 AM > To: informix-list@iiug.org > Subject: primary and unique index > > hi all, > in my database, I have a primary key with columns (a,b,c) and a unique > index > with columns (a,b,c). I think that the primary key is enough and i can > drop > the unique key. Wath do you think ??. > i can't drop the primaru key because it serves in the references > constraints. > > thanks for help. > > ______________________________________________________ > Get Your Private, Free Email at http://www.hotmail.com