Ultra-understand MySQL caching mechanism

Article Directory


Here Insert Picture Description

  • 1. When a client connects to a MySQL server, the server to be authenticated. Yes, it can be authenticated by an SSL certificate by user name and password authentication. After login authentication, the server also verifies that the client has permission to perform an operation a query.
  • 2. Prior to the formal inquiry, the server checks the query cache, if you can find the corresponding query, you do not have to query parsing, optimization, execution, etc., directly returns a result set cache.
  • 3.MySQL parser based on the query, construct a parse tree, is mainly used to verify the statement is correct according to the rules of grammar, such as SQL keywords are correct, the order of the keyword is correct.
    The preprocessor is mainly to further verification, such as table names, field names are correct, etc.
  • 4. The query optimizer will parse tree into a query plan, under normal circumstances, a query can have a variety of implementation, the final returns the same result, which the optimizer is to find the optimal execution plan based on cost
  • The implementation plan calls query execution engine, query engine through a series of API interface to query data
  • 6. After data is obtained, returned to the client at the same time, will present the query data cache
Published 44 original articles · won praise 5 · Views 2322

Guess you like

Origin blog.csdn.net/qq_45206551/article/details/105054976