1, positioning slow query-find out the execution slow SQL.
2, suitable table structure, appropriate engine, index, partition table, SQL optimization (single machine Optimization).
3, Multi-machine optimization--read/write separation (cluster), distributed.
4, the cache scheme.
Parsing slow query: Explain + SQL statement "using MySQL client"
Indexes are at the expense of insertion, modification, and deletion (because additions and deletions are required to maintain the index). The index is similar to the functionality of a directory.
The MYISAM,INNODB index is based on the binary tree index type. Memory supports hash and two fork trees.
Using an index is to turn the original full table scan into an index lookup.
MySQL index: Normal index (allow duplicates), unique index (mobile phone number, ID card, email), primary key index (cannot be empty), full-text index (only useful for MyISAM)
Relational database optimization