Re: [GENERAL] using ID as a key

Simon Drabble <simon@eskimo.com>

From: Simon Drabble <simon@eskimo.com>
To: davidb@vectormath.com
Cc: Postgres Group <pgsql-general@postgreSQL.org>
Date: 2000-02-04T22:37:08Z
Lists: pgsql-general
On Fri, 4 Feb 2000 davidb@vectormath.com wrote:

> 
> Finally, since you proclaim that you are new to database design, I cannot
> pass up this opportunity strike out against the forces of evil.  Unless you
> ABSOLUTELY cannot avoid it, never use more than one field as your primary
> key.  Oh, it seems like a good idea at design time, but it's not.  If you
> use
> complex primary keys, you and your programmers will regret it for the rest
> of
> the application's useful life.
> 
> 
> David Boerwinkle
> 


David,

What makes this such a bad idea? I am just now implementing a db that uses two
fields as primary key, and I'd like to know what I'm letting myself and
colleagues in for! I can only guess that it will slow down queries, but that's
not something a programmer should necessarily be concerned with..

(Thankfully it is not too late to change the design if need be :) )

Simon.


-- 
 "Linux - open doors, not windows."
   
   Simon Drabble                      It's like karma for your brain.
   simon@eskimo.com