Start MySQL
1. initialization module execution & initial storage engine execution
2. After the execution is completed in step 1 ----> the connection management module takes over
3. The connection management module starts the listening program (TCP/IP network listener and unix socket) that processes client connection requests)
4. Start complete and prepare to receive requests
Client Connection
5. Listen to connection requests from the Client (using relevant functions in the Network Interaction module) ----> protocol through the Client and Server interaction protocol module ---- communication matching ---->
6. Connection Management Module ---- request forwarding ----> thread management module ---- control forwarding ----> connection thread Module
7. connection thread module ---- call ----> User Module for authorization check ---- pass ----> thread pool request thread
Failed ----> return
Request query
8. When logs are enabled, logs are generated synchronously.
Query type requests (calling Parser (Query parsing and forwarding module) ----> (synchronous execution by the Access Control Module)
----> Query parser
----> (Select type) Call the query cache module ----> check whether the query cache already exists ----> return the data in the cache to the connection thread Module
The returned query parser does not exist (Query optimizer module)
----> (DML or DDL) to the table Change Management Module
----> Table maintenance module (updates statistics, queries for detection, repair, and sorting)
----> Copy module (copy related query)
----> Status collection report module (query of Request status)
----> Insert Processor
----> Delete Processor
----> Update Processor
----> Create Processor
----> Alter Processor
Command type request ----> direct execution (Parser does not need to be called)
9. After the preceding execution is completed, connect to the thread module and return the execution result.
Attachment:
Relationship between MySQL modules