I would like to add a index for quick lookups and uniqueness for a column called “Username”. I see an option to choose UNIQUE or INDEX. Should I create both, or just go with UNIQUE?
I am not using username as a primary key guys.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
UNIQUEcreates anINDEXautomatically for most dbs. So to answer you, you should create just one, which isUNIQUE. You can find a relevant thread here for MySQL