Get the App
SLTechnology News&Howtos  ›  Database  › 

What is the MySQL architecture?

Shulou Source: shulou.com Published: 2022-05-31 19:20:36 09月28日 Update

This article shows you what the MySQL architecture is, concise and easy to understand, which will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

What are the MySQL architectures?

1. Connectors refers to the interaction with SQL in different languages

2. Management Serveices & Utilities: system management and control tools

3. Connection Pool: connection pool

Manage caching requirements such as buffering user connections, threading, and so on.

4. SQL Interface: SQL API

Accept the user's SQL command and return the results that the user needs to query. For example, select from calls SQL Interface.

5. Parser: parser.

The SQL command is validated and parsed by the parser when it is passed to the parser. The parser is implemented by Lex and YACC and is a long script.

What are the MySQL architectures?

Main functions:

A. Decompose the SQL statement into a data structure and pass this structure to the next step, based on which the delivery and processing of the SQL statement is based.

b. If an error is encountered in the decomposition composition, then the sql statement is unreasonable.

6. Optimizer: query optimizer

The SQL statement uses the query optimizer to optimize the query before the query. He uses the "select-project-join" strategy to query.

It can be understood by an example: select uid,name from user where gender = 1

This select query is first selected according to the where statement, rather than querying all the tables first and then gender filtering.

This select query first projects attributes based on uid and name, rather than taking them all out and then filtering them.

Join these two query conditions together to generate the final query result.

7. Cache and Buffer: query caching

If the query cache has a hit query result, the query statement can directly fetch data from the query cache.

This caching mechanism consists of a series of small caches. Such as table cache, record cache, key cache, permission cache and so on.

8. Engine: storage engine

Storage engine is a specific subsystem dealing with files in MySql. It is also one of the most distinctive features of Mysql.

Mysql's storage engine is plug-in. It customizes a file access mechanism (called storage engine) according to an abstract interface of the file access layer provided by MySql AB.

Now there are many kinds of storage engines, each of which has different advantages, the most commonly used one is MyISAM,InnoDB,BDB.

By default, MySql uses the MyISAM engine, which has fast query speed, good index optimization and data compression technology. But it does not support transactions.

InnoDB supports transactions, provides row-level locking, and is widely used.

Mysql also supports its own customized storage engine, and even different tables in a library use different storage engines, which are allowed.

The above is what the MySQL architecture has, and have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Tags: Query cache engine storage structure statement architecture architecture difference that is data file mechanism user result support transaction content command attribute Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi OPPO Reno Shulou Information MySQL Shulou Tech Info