Mind Map
Preface
MySQL is not perfect, but flexible enough to adapt to demanding environments, such as web applications. MySQL runs well on many platforms and supports multiple data types, but does not support object types (MongoDB supports). MySQL storage engine can be created based on tables to meet the needs of data storage and performance, features and other features. Architecture logic View
Each dashed line is a layer, with a total of three layers.
The first layer is the service layer (Client Service). It performs connection processing, authorization authentication, and security for requests.
Layer 2: core layer: Query parsing, analysis, optimization, caching, providing built-in functions, stored procedures, triggers, and views.
The storage engine layer not only stores and extracts data, but also processes transactions for special data engines.
Connection Management and Security (Layer 1 service layer)
> Handling process
△Each connection query is completed in a thread in a process.
The Delta server is responsible for caching threads, so the service layer does not need to create threads for each connection.
> Authentication process
Optimization and execution
> Before parsing a query, the server "queries" Whether the query is cached (only select statements and corresponding results can be cached ). Cached direct return results require resolution queries, optimization, and re-execution of the returned results. > When parsing a query, an internal data structure (tree) is created and optimized accordingly. > Optimization: rewrite the query to determine the order of the read tables to be queried. Select the expected index. References high-performance MySQL