Next, Chapter 1 MySQL architecture and historical connection management and security each customer connection has an independent thread processing in the service. The query runs in this separate thread, and the thread runs on the CPU or core in turn. The thread is cached on the server, so you do not have to create or destroy each new thread. (Note 2 ). When the client (Application) is connected
Next, Chapter 1 MySQL architecture and historical connection management and security each customer connection has an independent thread processing in the service. The query runs in this separate thread, and the thread runs on the CPU or core in turn. The thread is cached on the server, so you do not have to create or destroy each new thread. (Note 2 ). When the client (Application) is connected
Next, Chapter 1: MySQL architecture and history
Connection Management and Security
Each client connection has an independent thread in the service for processing. The query runs in this separate thread, and the thread runs on the CPU or core in turn. The thread is cached on the server, so you do not have to create or destroy each new thread. (Note 2 ).
When the client (Application) is connected to the MySQL service, the server needs to authenticate. Authentication is based on the user name, access host, and password. X.509 authentication can also be used for connections through SSL (Secure Sockets Layer. When the client has been connected, the server checks whether the client has operation permissions for each request. (For example, check whether the client has the permission to perform the SELECT operation in the Country table of the wolrd database .)
Optimization and execution
MySQL parses the query request, generates an internal structure (resolution tree), and then performs various optimizations. This includes rewriting queries, determining the order of reading tables, and selecting the indexes to be used. You can instruct the optimizer through special keywords in the query to guide it to decide the operation steps. You can also ask the server about the optimization directions. This will let you know how the server makes a decision, which provides a reference for you to reconstruct the query, table structure, and optimization settings to make the service run efficiently. We will discuss the optimization details in chapter 6.
The optimizer does not really care about the storage engine used by tables, but the storage engine affects the server's Optimization Method for queries. The optimizer asks the storage engine about some of its features and the time consumed by specific operations and the statistics of table data. For example, some storage engines Support indexes and can effectively support queries. You can see in chapter 4 and Chapter 5