Implications of Primary Key

Mark McCormack

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



Eric Pearson

Re: Implications of Primary Key
(in response to Mark McCormack)
As far as access path (both bound and actual),
PK has no impact beyond what it would have as
a Unique Index.

And having a PK will make design tools like
ErWin etc. happier.


Regards,
eric pearson
NS ITO Database Support


-----Original Message-----
From: Mark McCormack [mailto:[login to unmask email]
Sent: Thursday, December 27, 2001 11:35 AM
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








Sanjeev (CTS) S

Re: Implications of Primary Key
(in response to Eric Pearson)
Mark,

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
>
>
>
>
>