When developing a new application / database for multiple users, a table for user management is usually required.
A table usually always has a username as well as an identifier ....
Just to check that I am not an idiot (well, you can still think it!) I just downloaded and looked at the scheme of both MediaWiki and PHPBB, and they do the same.
When I first learned about relational databases, I was always told that the big rule was never to duplicate data or do something unnecessary.
So why do we have an identifier as a primary key instead of a username?
I understand the reason if it was not unique (for example, a series of SO sites), but it is in these applications.
The only thing I could think of is faster Select * from xxx where ID="454"instead Select * from xxx where name="some_really_long_name"or because having long names will significantly increase the size of the database.
Are these the only reasons, or am I missing something here?
source
share