Quantcast
Channel: Answers for "Why use an int as a lookup table's primary key?"
Browsing latest articles
Browse All 12 View Live

Answer by Mrs_Fatherjack

I found this which explains it quite well. Essentially though the primary key must be unique and it's a lot harder to keep text unique than it is integers....

View Article



Answer by Kevin Feasel

There are two articles that I would say are must-reads on this topic. The first is [Michelle Ufford's post on what makes a good clustered index...

View Article

Answer by Blackhawk-17

One of the big reasons to use an INT is that it can be constantly increasing thus reducing or eliminating index fragmentation.

View Article

Answer by WilliamD

Don't forget that if the PK is the clustering key on the table it will appear in each and every index that is additionally created. If the PK is a CHAR(N) column, this will probably be larger in size...

View Article

Answer by Magnus Ahlkvist

I agree with all the points about using identity keys as clustered indexes to reduce fragmentation. But there's more to it. If you usually search on exact matches in the lookup value, I agree that you...

View Article


Answer by TimothyAWiseman

Kevin's answer is absolutely fantastic, but I think no discussion on primary keys can be complete without considering the pros and cons of natural, artificial, and surrogate keys, and the best place...

View Article
Browsing latest articles
Browse All 12 View Live




Latest Images