Home >Database >Mysql Tutorial >What is the basic framework of mysql database
Database is a warehouse that organizes, stores and manages data according to data structure. It has many types, from the simplest tables that store various data to large database systems that can store massive data. They are available in all aspects. a wide range of applications.
The database consists of two parts: the server and the storage engine.
The server includes connectors, analyzers, optimizers and executors. (MySQL after version 8.0 does not have a query cache. The reason is that when the data is updated greatly, the cache hits decrease, and the cache also faces frequent updates, so the entire module is directly removed.)
Connector: Responsible for tracking The client establishes a connection, obtains permissions, and then maintains and manages the connection.
It is worth noting that the process of establishing a connection by the connector is extremely complicated. It is recommended to use long connections as much as possible. The connection will occupy memory as temporary space during execution, and these resources will be released after the connection is disconnected. Long connections accumulate and occupy too much memory space, and will be forcibly killed by the system, resulting in an abnormal restart of the database.
There are two ways to solve this problem:
1. Disconnect long connections regularly.
2. (Mysql5.7 and later versions) After each relatively large operation is performed, the connection can be reinitialized by executing mysql_reset_connection.
Analyzer: parse the statement and determine whether the grammar is correct or incorrect.
Optimizer: Before execution, analyze, determine how to use the index, and confirm the connection order of each table.
Executor: Make permission judgment and execute.
Related recommendations: "mysql tutorial"
The above is the detailed content of What is the basic framework of mysql database. For more information, please follow other related articles on the PHP Chinese website!