I have a table:
ID (auto increment, int), pass (char(5)), email (varchar(80))
This is set to be used for:
Adding rows for each new user (high load).
Updating their account to add an email address.
If users forget ID, they can enter their email address and it will return the ID)
There are very very few deletes (once a week in bulk usually). The ratio is about 70% inserts, 25% email updates, 5% search by email address.
Whats structure would you say is best for this?
ID is going to be a primary key, should I set email as a key too?
For what it’s worth, I’d go with InnoDB so that you get row-level locking. If “email” appears in a WHERE clause it should minimally be indexed for performance reasons.