Re: Should I use database foreign key constraints and indexes as primary keys
Date: 11 Jul 2002 13:14:59 -0700
Message-ID: <bc814416.0207111214.2ed4c6e7_at_posting.google.com>
Sorry for the confusion:
I should have asked how people feel about using indexes as primary keys. Index being a sequence in Oracle or a Identity in SQL Server. I should have also asked how people feel about using foreing key constraints.
Thanks, Carl
"David Cressey" <david_at_dcressey.com> wrote in message news:<rNgX8.9$Jd4.917_at_petpeeve.ziplink.net>...
> --
> > What I meant by a table index being a: "Unique reference to the table
> > so that a change to a datafield doesn't require a change to all tables
> > that reference it" Is that if you have a table that uses business
> > data as a primary key and the business data changes then you have to
> > update the business data in all tables that might reference it.
>
> Your definition of "index" is not the common one. It sounds like you are
> trying to define
> "primary key", but I'm not sure. In common parlance, an index is a data
> structure that facilitates
> rapid access to one or more table rows, given part of the contents found
> there. Primary keys are usually indexed,
> but indexes can be built on columns that are not primary keys.
>
> > In general do you use foreign keys and indexes?
>
> In the same vein, I'm taking this to mean "foreign keys and primary keys."
> Forgive me if I'm misunderstanding you.
>
> If you are building a relational database, you use foreign key references to
> primary key values all the time, whenever you need to represent data
> relationships.
>
> If you are building a non relational database, and plan on storing it in a
> relational DBMS, you are going to have a certain amount of difficulty.
>
> Good luck.
>
> >
> > - Carl (Software Engineer)
> >
Received on Thu Jul 11 2002 - 22:14:59 CEST