Re: Cascade updates on primary keys..
From: David Browne (meat_at_hotmail.com)
Date: 12/17/04
- Next message: Marc Cramer: "Re: Redirect to multiple pages without displaying each page..."
- Previous message: Bob Powell [MVP]: "Re: Best way to check for trial expiration"
- In reply to: Samuel R. Neff: "Re: Cascade updates on primary keys.."
- Next in thread: Francois: "Re: Cascade updates on primary keys.."
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 17 Dec 2004 15:29:51 -0600
"Samuel R. Neff" <blinex@newsgroup.nospam> wrote in message
news:91d6s0pdr7l99249d5nbl4nm4ku29n7433@4ax.com...
>
> When the primary key is used as a foreign key in another table, then
> the use of a compound primary key is both wasteful and
> non-normalized--it duplicates data unnecessarily.
>
It's not "non-normalized" because the rules for normalization take no notice
of whether a key is simple or compound. It just doesn't affect the
normalization.
It's not "wasteful" beacuse what you loose in storing the longer foreign key
on the table, you often make up for in having fewer total indexes on the
tables. Also it simplifies and dramatically speeds filtering the related
table by the compound key columns.
EG
select sum(amount)
from order_details
where customer = 1
instead of
select sum(amount)
from order_details
where order_id in ( select id
from order
where customer = 1)
David
- Next message: Marc Cramer: "Re: Redirect to multiple pages without displaying each page..."
- Previous message: Bob Powell [MVP]: "Re: Best way to check for trial expiration"
- In reply to: Samuel R. Neff: "Re: Cascade updates on primary keys.."
- Next in thread: Francois: "Re: Cascade updates on primary keys.."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|