I have a pretty simple table (forgive / stupid, I'm still involved. Written for MySQL):
CREATE TABLE IF NOT EXISTS `userdata` ( `userid` UNSIGNED int(18446744073709551615) AUTO_INCREMENT, `username` char(255) NOT NULL, `password` char(255) NOT NULL, `salt` char(255) NOT NULL, `email` char(255) NOT NULL, PRIMARY KEY(`userid`) );
I read that adding an index improves query performance since it does not need to browse the entire database. Instead, it will look at the index and collation data (correct me if I am wrong).
I figured out how to create an index well enough, but not what I should index.
Should I have my own index for usernames? Email addresses, user ID or any field that I have not yet added?
source share