Should i really use integer primary IDs?
- by arthurprs
For example, i always generate an auto-increment field for the users table, but i also specifies an UNIQUE index on their usernames.
There is situations that i first need to get the userId for a given username and then execute the desired query. Or use a JOIN in the desired query.
It's 2 trips to the database or a JOIN vs. a varchar index
The above is just an example
There is a real performance benefit on INT over small VARCHAR indexes?
Thanks in advance!