Re: Table design question
Posted in 1999
>Don Pritchard wrote: >> >> Hi All >> >> I've always battled against this one : >> >> If you were creating a staff table >> >> Would you have the following >> >> staff_id serial >> fname char(20) >> mname char(20) >> lname char(20) >> .. >> .. >> .. >> >> where obviously staff_id is the primary key >> >> *or* >> >> fname char(20) >> mname char(20) >> lname char(20) >> .. >> .. >> .. >> >> Where the primary key is a combo of the first 3 fields >> >> The second is a bigger index but it dispenses with a code field. >> >> Any thoughts? The second one is not guaranteed to be unique, anyway. And it would be much slower. >I would definitely go with a surrogate key. It keeps the key (index) >size down (4 bytes instead of 60) and improves performance. Which is >exactly what the SERIAL type was designed for. -- "I'll Be Back" Obnoxio ************************************************ Sane? Hell, if I was sane, why would I be here? Get Your Private, Free Email at http://www.hotmail.com