High performance MySQL reading notes--mysql logical architecture

Source: Internet
Author: User

I. MySQL logical architectureMySQL's most important and distinct feature is its storage engine architecture, which is designed to separate query processing from other system tasks and data storage/extraction.


The first layer, the service layer, the top level of service is not unique to MySQL, most web-based client/server-side tools or services have a similar architecture. Mainly for the request to do connection processing, authorization authentication, security and so on.

The second, core, and most MySQL core service functions are in this layer, including query parsing, parsing, optimization, caching, and all of the built-in functions (such as date, time, math, and cryptographic functions), all of which are implemented at this level: stored procedures, triggers, views, and so on.

Third tier, storage engine, storage engine is responsible for the storage and extraction of data in MySQL. The server communicates with the storage engine through the API. These interfaces mask the differences between different storage engines, making these differences transparent to the upper-level query process. The storage engine does not parse SQL, and the storage engine does not communicate with each other, but simply responds to requests from the upper service.

Connection management and security (first tier service tier) > Connection Process


Δ each connected query is completed in a thread in a process.

Δ the server is responsible for caching threads, so the service layer does not need to create or destroy threads for each new connection (you can use the thread pool).

> Certification Process

1. When the client (app) connects to the MySQL server, the server needs to authenticate it. Authentication is based on user name, original host information, and password. If you are connecting using a secure socket, you can also use the certificate authentication for the certificates.

2. Once the client connection succeeds, the server continues to verify that the customer has permission to execute a query (for example, to execute a query statement on a library table)


Optimization and execution

1. mysql interprets queries, creates internal data structures (parse trees), and then optimizes them, including rewriting queries, determining the order in which tables are read, and selecting the appropriate indexes.

2, for the SELECT statement, before parsing the query, the server will first check the query cache, if it can hit, the server will not have to perform query parsing, optimization and execution of the entire process, directly return to the query cache result set.

MySQL Focus: "High performance MySQL" Reading notes-index : http://blog.csdn.net/xifeijian/article/details/20312557

High performance MySQL reading notes--mysql logical architecture

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.