You know the scene. The database is just too slow. Queries are queuing up, backlogs growing, users being refused connection. Management is ready to spend millions on “upgrading” to some other system, when the problem is really that MySQL is simply not being used properly. Badly defined or non-existent indexes are one of the primary reasons for poor performance, and fixing these can often lead to phenomenal improvements. Consider an extreme example:

CREATE TABLE employee (
    employee_number char(10) NOT NULL,
firstname varchar(40),
surname varchar(40),
address text,
tel_no varchar(25),
salary int(11),
overtime_rate int(10) NOT NULL
); 

To find employee Fred Jone’s salary(employee number 101832), you run: SELECT salary FROM employee WHERE employee_number = '101832'; MySQL has no clue where to find this record. It doesn’t even know that if it does find one matching, that there will not be another matching one, so it has to look through the entire table, potentially thousands of records, to find Fred’s details.

More details: http://www.databasejournal.com/features/mysql/article.php/1382791

Tags: Application Database Mysql Php Web, Application Core Development Mysql Php Series Web, 5 Approach Php Problem Recipe Solution, Web Hosting Php Mysql, 4th Development Edition Mysql Php Web