Our standard practice has been to create a PK on every table we
create. However, it has occurred to me to question that practice in
certain cases. Let's say we have table INVOICE which holds telecom
invoice data. If an invoice is long-distance, we will have one row in
the child LD table, and none in the child LOCAL table, and vice versa
for local invoices. We may also have an invoice with both, which will
result in one row in both LOCAL & LD.
We always lookup to the children based on the INVOICE FK; we
never perform lookups based on the child PK's; you can never have a
child record without a parent record; and none of the child tables
will ever have children of their own.
So, is there any advantage to creating a PK for the child tables?
It seems like extra clutter and wasted index space, and I am inclined
right now just to create all my one-to-zero-or-one tables with the
parent table FK as the PK. Thanks!
Received on Thu Aug 09 2001 - 18:38:00 CEST