Subject RE: [firebird-support] Is Unique Index needed
Author Alan McDonald
> Hi All,
>
> FB 1.5 RC 7
>
> I am using PowerDesigner as my modelling tool and generate the
> following CREATE TABLE ddl:
>
> create table CDS_SYSTEM (
> NAME VARCHAR(100) not null,
> VALUE VARCHAR(100) not null,
> constraint PK_CDS_SYSTEM primary key (NAME)
> );
>
> create unique asc index CDS_SYSTEM_PK on CDS_SYSTEM (
> NAME
> );
>
> My question is since there is already a primary key, is the
> unique index still needed?
>
> What is the benefit of having unique index since we already got a
> primary key in the table ?
>
> Thanks.
>
> cm

The creation of a primary key will also create an ascending unique index
constraint. Don't double up on this. You may add a descending index on that
field if you really need it.
Alan