Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Location Of A Key(s) in a Record

Status
Not open for further replies.

JayKusch

MIS
Oct 30, 2001
3,199
US
Is there a valid point to be said for having any field(s) that are a key, or part of a key, at the top of the record?

I have seen tables created with all the key fields at the top of the record and then others where the keys are dispersed all about the table.

This is inclusive of PKs and FKs. Thanks

J. Kusch
 
I tend to put my primary key fields first, just to make them easy to find. I suspect if it is a very large record with a number of variable length fields there might be a small performance penalty for having the keys at the end, but I have no proof of this.

That being said, I doubt that it makes enough difference to start re-arranging the tables.


 
Gearing up to do a rewrite of a current DB. one of my team members brought the discrepencies to my attention and poised the question to me. I too have always set my keys and indexed fields towards, if not in, the front. I did not have a good answer as to why do it this way. Thanks for your input. Thanks

J. Kusch
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top