当前位置:网站首页>Execution process of select statement in MySQL
Execution process of select statement in MySQL
2022-07-26 17:07:00 【TABE_】
MySQL The architecture of is shown in the figure below :
One select The execution process of the statement is as follows :
- Establishing a connection : By username and password and mysql Server establishes connection . If the username and password are incorrect , Is displayed “Access denied for user” A hint of .
- The query cache : Previously executed sql The result of the statement will be key-value The form of the pair is cached in memory .key yes sql sentence ,value Is the query result . If select Statements in key in , Then return directly value To the client . If you can't find... In the cache , Will continue to carry out the subsequent stages . Cache the results in memory after execution , For next query .( Cache invalidation is very frequent , for example update Then the cache will be emptied ).
- Parser : If no data is found in the cache , The parser will do sql Statement analysis . First pair sql Sentence for lexical analysis , analysis select * from table Compliance mysql Grammatical norms of . Then on sql Statement syntax analysis , If sql The statement is wrong , Is displayed You have an error in your SQL syntax Error warning .
- Optimizer : Before we start executing , The optimizer chooses which index to use based on the indexes in the table , Or is it join Select the order of table connection . So as to choose the best scheme .
- actuator : The executor will check the permissions of the current connection , The most direct way is to check whether the current connection is to the data table user Have query permission . If the current connection is to the data table user No query permission , An error with no permissions is returned . If the current connection has a connection to the data table user The query authority of , Will continue to execute . First, open the data table , At this point, the optimizer will be based on the storage engine used when creating the table , Use the interface of the corresponding storage engine to perform the query operation .
边栏推荐
- Stop using xshell and try this more modern terminal connection tool
- Alibaba side: analysis of ten classic interview questions
- Nacos win10 installation and configuration tutorial
- Response object - response character data
- [ctfshow-web]反序列化
- How to write unit tests
- Win11 how to close a shared folder
- Vs2017 opens the project and prompts the solution of migration
- Win11怎么重新安装系统?
- 如何借助自动化工具落地DevOps|含低代码与DevOps应用实践
猜你喜欢

Differences between the use of structs and classes

如何保证缓存和数据库一致性

What is a distributed timed task framework?

Matlab论文插图绘制模板第40期—带偏移扇区的饼图

37.【重载运算符的类别】

Pyqt5 rapid development and practice 3.2 introduction to layout management and 3.3 practical application of QT Designer

FIR filter design

Marxan模型保护区优化与保护空缺甄选技术、InVEST生态系统中的应用

Nacos win10 安装配置教程

操作系统迁移实战之在openEuler上部署MySQL数据库
随机推荐
Guetzli simple to use
Vscode batch delete
[ctfshow-web]反序列化
2022 Niuke summer multi school training camp 1 (acdgij)
广东首例!广州一公司未履行数据安全保护义务被警方处罚
Configmap of kubernetes
Difference between C event and delegation
[ctfshow web] deserialization
2022 software testing skills postman+newman+jenkins continuous integration practical tutorial
Realizing DDD based on ABP -- related concepts of DDD
Definition and relationship of derivative, differential, partial derivative, total derivative, directional derivative and gradient
极大似然估计
Nacos win10 installation and configuration tutorial
Guangzhou Municipal Safety Committee Office issued warnings and reminders on safety precautions in hot weather
中金证券vip账户找谁开安全啊?
Win11系统如何一键进行重装?
“青出于蓝胜于蓝”,为何藏宝计划(TPC)是持币生息最后的一朵白莲花
导数、微分、偏导数、全微分、方向导数、梯度的定义与关系
6种方法帮你搞定SimpleDateFormat类不是线程安全的问题
37. [categories of overloaded operators]