Implications of Primary Key

Mark McCormack

Implications of Primary Key

December 27, 2001 10:35 AM

DB2 for OS/390 v6.

We have been having discussions about the advisability of creating
a
Primary Key on a table when there is no DB2-enforced referential
integrity.
I suspect that there are some people who do this regularly and some
who do
this never.

Does a Primary Key cause a longer code path ? In other words, does
the
existence of a Primary Key cause DB2 to search for a RI
relationship that
is not there ?

We have been having discussions about the advisability of creating
a
Primary Key on a table when there is no DB2-enforced referential
integrity.
I suspect that there are some people who do this regularly and some
who do
this never.

Does a Primary Key cause a longer code path ? In other words, does
the
existence of a Primary Key cause DB2 to search for a RI
relationship that
is not there ?

Any information will be appreciated.

Mark McCormack
State Street Corporation

Sanjeev (CTS) S

I believe creation of PK depends on the logical data model more
than
dependencies by RI. As far as performance is concerned, i don't
think it
will have much of the impact. But the advantage of having PK (with
or
without RI) is, it gurantees us uniqueness (if required by logical
data
model). If you are relying on unique index for the uniqueness, it
may be
missed to be created by someone or if dropped, it is very difficult
to find
its impact. This is the reason i think PK design enforces the
creation of
unique index.

With Best Regards,
Sanjeev

> -----Original Message-----
> From: Mark McCormack [SMTP:[login to unmask email]
> Sent: Thursday, December 27, 2001 10:05 PM
> To: [login to unmask email]
> Subject: Implications of Primary Key
>
> DB2 for OS/390 v6.
>
> We have been having discussions about the advisability of
creating a
> Primary Key on a table when there is no DB2-enforced
referential
> integrity.
> I suspect that there are some people who do this regularly and
some who do
> this never.
>
> Does a Primary Key cause a longer code path ? In other words,
does the
> existence of a Primary Key cause DB2 to search for a RI
relationship that
> is not there ?
>
> Any information will be appreciated.
>
> Mark McCormack
> State Street Corporation
>
>
>
>
>