954,580 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

What is dis-advantages of auto-increment pk

Hi

Please tell me if you know a dis-advantage of auto-incerment PK

Thanks

motofoto
Newbie Poster
8 posts since Jun 2008
Reputation Points: 10
Solved Threads: 0
 

Ah, you again

Did you proceed in understanding EERM?

I call people who put a magical, universal "id" column with an auto-increment on all their tables "id-iots" ! (Joe Celko)

tesuji
Master Poster
721 posts since Apr 2008
Reputation Points: 158
Solved Threads: 98
 

Ah, you again

Did you proceed in understanding EERM?

I call people who put a magical, universal "id" column with an auto-increment on all their tables "id-iots" ! (Joe Celko)


No I mean that if you design a table like Book which is containing duplicate ISBN(s) for some reason,

and you have the choice between
creating a random unique generated PK from say (Java code)
and
creating an auto incerment Column

What do u choose and why?

I thought you will talk to me about deletion problems or overflow problems regardless of id-iot people.

and I searched about EERM in google, I don't know what is its stands for, I can conclude that you are talking about Relational Modeling but I want to know what that stands for.

Thank you for your time

motofoto
Newbie Poster
8 posts since Jun 2008
Reputation Points: 10
Solved Threads: 0
 

EERM = Extended Entity Relationship Model

I would say auto increment column as if you want to keep track of next item number to be used you need to run extra query to get current number. Plus there are other thing you would have to take care from coding point of view

@tesuji, please drop that joke about "id-iots"

peter_budo
Code tags enforcer
Moderator
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You