MySQL1: How to run a SQL statement

 

 Component role:

1•Connector: Identity authentication and permissions are related (when logging in to MySQL).

2•Query cache: When executing a query statement, it will first query the cache (removed after MySQL 8.0 version, because this function is not very practical).

3•Analyzer: If there is no cache hit, the SQL statement will pass through the analyzer. The analyzer will first see what your SQL statement is doing, and then check whether your SQL statement syntax is correct.

4•Optimizer: According to MySQL considers the optimal plan to execute.

5•Executer: execute the statement, and then return the data from the storage engine.

 

to sum up:

1•MySQL is mainly divided into Server layer and engine layer. The Server layer mainly includes connectors, query caches, analyzers, optimizers, executors, and a log module (binlog), which can be shared by all execution engines , Redolog is only available in InnoDB.

2•The engine layer is plug-in type, currently mainly including MyISAM, InnoDB, Memory, etc.

3•SQL and other execution processes are divided into two categories, one category for query and other processes is as follows: permission verification --- "query cache ---" analyzer --- "optimizer ---" permission verification --- 》Actuator---》Engine

4•The execution process for statements such as update is as follows: Analyzer----"Authority Check----"redo log prepare---"Executor---"Engine---"binlog---"redo log commit

 

Guess you like

Origin blog.csdn.net/qq_42198024/article/details/108399163