Farmers in yards world, beautiful application experience, from the programmer for the processing of detail, and self requirements state, agriculture in the yard a member of the young people is busy, every day, every week, can leave some footprints, is the creation of content, there is a persistent, is I don’t know why, if you lost, might as well to Chou Chou code track of farmers.
- Beautiful musical beats take you through the coding process of this effect
- Insist on every day, is the pursuit of every ideal youth
- Follow in the footsteps of young people, and maybe your answer is right here
- Take a look here if you’re confused
In a normal query, as shown below, you see an infinite list of users displayed
select * from t_user
Copy the code
Do you know what happens when you click execute query??
1 Step 1 Establish a connection
In the first step, your client will connect to the database. In this case, the connector is responsible for establishing the connection with the client, obtaining permissions, and maintaining and managing the connection.
The connector then validates the username and password information you provide to create the connection
Step 2 Classic query cache
Once the connection is established, the second step is to query the cache. If the query has been executed, the mysql database will cache the query statement and its result in key-value pairs (key is the query statement, value is the query result). If the query statement has been executed, the mysql database will cache the query statement and its result in key-value pairs (key is the query statement, value is the query result)
It is called the classic query cache because MySQL 8.0 removes the entire function of the query cache. The query cache tends to do more harm than good. The invalidation of the query cache is very frequent, and whenever a table is updated, all the query cache on that table is cleared.
3 Step 3 The parser analyzes the syntax
The parser first does “lexical analysis”, analyzing keywords such as SELECT and update, and then identifying other strings as columns in a table
Then do the syntax analysis, combined with the results of the lexical analysis to check whether the entered SQL statement meets the MySQL syntax
If syntax is not correct, You will receive an error warning “You have an error in your SQL syntax”. General syntax error will indicate the first error position, check the content of “use near”.
Step 4 optimizer
After the parser validates the SQL syntax, MySql knows what the input SQL is going to do. The next step is to perform further optimizations. For example, when the query table has multiple indexes, the optimizer decides which index to use. Or determine the order in which tables are joined when a statement has multiple joins.
5 Step 5 actuator
The executor is used to manipulate the data storage engine, the analyzer analyzes the target of the SQL, the optimizer determines the execution scenario, and the executor performs the responsibility.
The completion of
Not limited to thinking, not limited to language restrictions, is the highest realm of programming.
With xiaobian character, must be to record a set of video, and then upload
If you are interested, you can check out the watermelon video – early risers