Start MySQL
1. Initialization of module execution && storage engine Initial execution
2, 1 after execution----> Connection Management module took over
3. The connection Management module initiates a listener that handles client connection requests (TCP/IP network snooping, UNIX sockets)
4. Start complete, prepare to receive requests
Client connections
5, the supervisor hears the client's connection request (uses the correlation function in the network interaction module)----> Communication matching through client & Server Interaction Protocol Module Protocol-------->
6. Connection Management module----Request forwarding----> Thread Management module----Control transfer----> Connect Threading Module
7. Connect Thread module----CALL----> User module for authorization check----request thread by----> thread pool
Do not pass----> return
Request Query
8, open the log, the log will be generated synchronously
Query type request (call parser (Query parsing and forwarding module))----> (Access Control module synchronous execution)
---->query Parser
Call the query cache module----> (select type)----> Check to see if it already exists in query cache----> existence returns data from the cache to the connection thread module
There is no return query parser (query optimizer module)
----> (DML or DDL) to table change Management module
----> Table Maintenance Module (query for updating statistics, detecting, repairing, and collating classes)
----> Replication module (copy related query)
----> Status Collection Report Module (query for request status)
---->insert Processor
---->delete Processor
---->update Processor
---->create Processor
---->alter Processor
command type request ----> Direct Execution (no call to parser)
9, above execution completed----> Connection thread module----> Return execution results
Attached sheet:
MySQL diagram of each module