MySQL MySQL components and how it works

Source: Internet
Author: User
Tags table definition

MySQL Composition:

Connection Manager
is responsible for listening on a port socket and accepting user requests.

Thread Manager:
A new thread is generated for the user's request and is responsible for destroying the process or completing the reuse of the process after the request is completed.

User module:
Verify that the user has permission to connect to the server. Verify the identity of the user.

Command Distribution module:
Depending on the type of query, interacting with the cache module, and the log module. If the cache is not given to the parser processing, the log must be logged to the log module.

Parser:
Parsing the syntax and morphology of the query, querying the cache again, without generating the parse tree. If select is given to the query optimizer. If update, DELETE, INSERT, create and so on to the table definition module, repare to table maintenance module.

Cache Manager:
Responsible for managing the cache.
Displacement policy: Use a displacement policy to guarantee effective memory space.
In general, the least recent thought, that is, the most recent time by the least used in the block is replaced.
Some blocks that you do not want to replace can be set as pinned blocks.

Log Manager:
Logs are logged.

Query optimizer:
The parse tree is optimized to perform the most expensive execution mode on the server.

Table Definition Module (table modification module):
Check the integrity and permissions of the data associated with the table operation.
Responsible for table creation, deletion, renaming, removing, updating, inserting, and so on.

Table Maintenance Module:
A logic error to fix the table. Check user permissions.
Responsible for table inspection, modification, backup, recovery, optimization (defragmentation), parsing.

Status Reporting module:
The update operation performs status report information.

Copy module:
Responsible for data synchronization and so on.

Access Control module:
Check whether the user has permission to complete the corresponding operation.

Table Manager:
Responsible for interacting with the storage engine interface, converting the table definition to a file based on the operation of the table definition module. Responsible for creating and modifying the Read table definition file.

The table definition file is used to store the table structure.

Maintain table Descriptor cache:
Table definitions and names are usually cached in memory, and the table's format is cached in memory after the table is read.

Manage table locks.
When a user modifies the contents of a table, other users cannot manipulate it.

Work in conjunction with the table definition module and the table maintenance module.

Storage Engine:
Plug-in. Responsible for bidirectional transformations of the presentation and physical layers.
To interact with the data on the disk.

MySQL workflow.

User request--Connection Manager (responsible for receiving)--thread manager (build thread)--User module (verify identity, connect via then, reject for pass)--connection established.

The user sends the query statement--the Command distribution module (query cache, logging. No distribution commands in cache)--parser (parse statement, query cache, build parse tree)--Query optimizer | Table Definition module | Table Maintenance Module | Status Report Module | Replication module-access control module (verify user Rights)--Table Manager (table structure operation, Table lock management, cache management)--storage engine (file operation)

This article is from "Small Private blog" blog, please be sure to keep this source http://ggvylf.blog.51cto.com/784661/1679320

MySQL MySQL components and how it works

Related Article

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.