Chapter VI High Performance MySQL

 

Query optimization, index optimization, database table structure optimization needs go hand in hand, not a fall, in order to ultimately design can play good results in the actual scene programs.

 

Why the query speed will be slower?

If the query as a task, which consists of a series of sub-tasks, each sub-task will consume a certain amount of time. If you want to optimize the query, in fact, to optimize its subtasks, or Xiongchu some sub-tasks, or reduce the number of sub-tasks to perform, or let the task run faster.

 

How to optimize data access?

1, does not need to confirm whether the requested data to the database

2, MySQL confirm whether the scanning of additional recording

3, confirm how the query, and the right to be reconstructed

 

When you want to be able to query MySQL running with higher performance, the best way is to figure out how to optimize MySQL and execute the query. Once you understand this, a lot of query optimization actually follow some principles for the optimizer to run in a reasonable manner expected.

Then, when a query is executed MySQL, MySQL in the end to do what?

1, the client sends a query to the server

2, the server first checks the query cache, if the soul hit village, then immediately returns the result stored in the soul of the village. Otherwise, proceed to the next stage.

3, the server side SQL parsing, pre-processing, then the corresponding execution plan generated by the optimizer

4, MySQL based on the execution plan generated by the optimizer, with a strip storage engine API to execute the query

5, the results are returned to the client

 

Guess you like

Origin www.cnblogs.com/stone94/p/12444491.html