MySQL execution process

Source: Internet
Author: User

MySQL execution process

We can manually divide the main functions of MySQL into the following modules.

1. Initialize the module

When MySQL starts to perform initialization work, such as reading the configuration file, assigning some global variables (sql_model,catch buffer), loading the control table, memory allocation, and so on, after the initialization module executes, the controller is handed over to the

Chain receiver Manager

2. Execution process

A user connects to the Connection management module first, and then the connection management module notifies the thread management module to assign a thread to the user module to authenticate the user, when the user module is finished, the server can accept the command from the client, the command sent by the user is passed to the command dispenser,

In the command dispatcher, adding is a query statement, he will go to the query cache module to see if it is cached (as long as we cache this query to open), command dispatcher he will also notify the log module to save our commands, put into the general_log inside, And I didn't wait for the order to finish, so I got a record.

Below, the command dispatcher passes the command to the command parser, sending commands to different modules such as query optimizer (DML), table change module (DDL), table maintenance module (check, compress), replication module, state module (state variable, server information) through the parsing of the command parser

And then they call the access control module according to their own needs. Access control module A list of tables is sent, which detects that the user has no permissions on the table or column permissions He will give the controller to the Table Management Module table Management module will read from the. frm file, or take a lock, when it is done, it calls the storage Engine interface to implement.

MySQL execution process

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.