I read somewhere that one should not create many indexes on the columns of a table for it reduces the performance of operations.
But when I create a table with UNIQUE NOT NULL fields, the MySQL is creating indexes on all the fields by itself. Doesn't that reduce the performance?? If yes, what flags I need to change the default behaviour? If not, then where I am wrong?
My Table:
CREATE TABLE Users(
Id_usr INT UNSIGNED NOT NULL AUTO_INCREMENT,
PRIMARY KEY(Id_usr),
Email_id varchar(45) UNIQUE NOT NULL,
username varchar(30) UNIQUE NOT NULL,
userpass varchar(30) NOT NULL
);
When I see the table on phpmyadmin:
Indexes: Documentation
Action Keyname Type Unique Packed Column Cardinality Collation Null Comment
Edit Edit Drop Drop PRIMARY BTREE Yes No Id_usr 0 A
Edit Edit Drop Drop Email_id BTREE Yes No Email_id 0 A
Edit Edit Drop Drop username BTREE Yes No username 0 A