当前位置:网站首页>Complete process of MySQL SQL

Complete process of MySQL SQL

2022-07-07 06:58:00 Rookie ~ ~

mysql client and mysql server When communicating , If you finish all the MySQL Server modular , It needs to pass through the connector in turn 、 Parser 、 Optimizer 、 actuator 、 Storage engine , As shown in the figure below :
 Insert picture description here

  • The connector : Use TCP Encrypted ssl Communication protocol , Manage connections , Control the maximum connection amount , Test connection duration , Authority verification ( Account password, etc ), Priority query cache ( Twice the same select There are update operations between , The query cache will be emptied )
  • Parser : The same role as the compiler , To generate a syntax tree , analysis SQL Lexical and grammatical analysis
  • Optimizer : Generate SQL Implementation plan and current SQL Selection of corresponding index (explain You can see )
  • actuator : Call the storage engine corresponding API Interface to read and write data
  • Storage engine : Cost disk I/O Read and write disk data , structure B+ Tree index , Transaction log (undo log/redo log), Locking mechanism , Isolation level …
class BaseEngine{
    }

class MyISAM : public BaseEngine{
    }
class InnoDB : public BaseEngine{
    }

If a simple communication , The client will actively close the connection after receiving the result of this communication ,MySQL Server The connector is responsible for closing this connection , Recycle the resources of this connection .
 Insert picture description here

原网站

版权声明
本文为[Rookie ~ ~]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207070239401508.html