There are multiple reasons why the e-mail addresses being
primary keys are a bad idea. I'm listing some below:
- Primary keys are supposed to be UNIQUE and CONSTANT. E-mail
addresses are liable to change. They cannot be changed and hence,
it's inconvenient. This might happen if some e-mail provider goes
out of business and now you have to update all the user's e-mails
and the fields associated with the primary key.
- It will be slower when doing joins.
- Any other record that has a posted foreign key will have a
larger value now, taking up more disk space. (It might be a trivial
issue but the record now takes longer to read.)
- String comparisons are generally slower than integer
comparisons. It might not be an issue if you're looking up a user
but it will be a problem if there are complex joins.
- Some businesses might share a common e-mail service and this
will lead to duplicate fields. For eg., kbiswal@some_company.com
might belong to both Kamal Biswal and Kritesh Biswal.
This is why an e-mail might be useful as a secondary key for a
lookup but using it as a primary key will be very inconvenient in
the long run.