Re: Should I use database foreign keys and indexes

From: David Cressey <>
Date: Thu, 11 Jul 2002 07:04:01 GMT
Message-ID: <B5aX8.7$>

Many web designers do not know the power of a good relational design. For that reason, they opt for a design
that seems simpler to them, and requires less resources. The result is often a disaster, when it comes to making productive use out of the data in the database.

The database design should fit in well with the overall architecture of the application of which it is a part.
The architecture of many OLTP applications in the past has benefited enormously by a database design
that models the subject matter accurately and relevantly, stores data effectively and efficiently, and
makes use of the power of the system to join data smoothly and efficiently, when necessary.

Web based OLTP applications are not that different, in this respect, from OLTP applications from before the web era. The reason recent apprentices don't think that this is true is because they don't know any better.

    David Cressey
"Carl" <> wrote in message

> I recently had a discussion with several web application developers
> where I work about the use of foreign keys and table indexes.
> I always thought that they were both basic elements of relational
> database modeling and should be included in all of your database
> designs. I was suprised that they felt that foreign keys and indexes
> add unnecessary complexity to a database and that they never use
> foreign key constraints and rarely use indexes as a primary key. I
> would like to know your thoughts on using foreign keys and indexes in
> a database. The pros and cons I have thought of thus far are:
> Foreign Keys Constraints:
> Pro:
> Provide referential integrity
> Con:
> May have to disable when you are doing mass updates
> Table Indexes as Primary Key:
> Pro:
> Unique reference to the table so that a change to a datafield
> doesn't require a change to all tables that reference it
> Con:
> May have to do a table join to search on a particular table field
> Please add any comments you have.
> Thanks,
> Carl
Received on Thu Jul 11 2002 - 09:04:01 CEST

Original text of this message