当前位置:网站首页>Analysis of InnoDB execution process in MySQL
Analysis of InnoDB execution process in MySQL
2022-04-23 12:29:00 【Anxious two dogs】

The concepts in the figure can be referred to https://blog.csdn.net/qq_36364521/article/details/121727899 Medium mysql The links below understand
The overall architecture :
1、 Link layer
2、server layer
3、 Storage engine layer
adopt sql Query configuration information :
There are two kinds 1、variables 2、status
eg:1、show variables like ‘%query_cache%’ cache Open or not
2、show global status like ‘%Thread%’ How many links are there
Optimizer :
explain sentence
explain format = json See more , At the same time get cost_info
eg: explain format = json select * from business_a.monitor_app_a
Get the results :
{
“query_block”: {
“select_id”: 1,
“cost_info”: {
“query_cost”: “5.00”
},
“table”: {
“table_name”: “monitor_app_a”,
“access_type”: “ALL”,
“rows_examined_per_scan”: 20,
“rows_produced_per_join”: 20,
“filtered”: “100.00”,
“cost_info”: {
“read_cost”: “1.00”,
“eval_cost”: “4.00”,
“prefix_cost”: “5.00”,
“data_read_per_join”: “104K”
},
“used_columns”: [
“id”,
“app_name”,
“aone_app_id”,
“status”,
“is_delete”,
“create_time”,
“create_user”,
“update_time”,
“update_user”,
“domain_url”
]
}
}
}
If you want to print each sql The plan implemented can :
1、 Turn on
set optimizer_trace = ‘enabled=on’;
2、 perform sql
A little
3、select * from information_schema.OPTIMIZER_TRACE;
see :https://blog.csdn.net/weixin_34192816/article/details/86082371
After execution, we get : Several stages of data :1、sql Get ready 2、 Optimization stage 3、 Execution phase
mysql Mainstream storage :
MyISAM、innoDB、Memory、Archive、NDB
innoDB The adaptive hash Indexes
1.innodb Its index structure is B+tree, and hash The index is innodb Features and functions provided by the storage engine
2.innodb The storage engine monitors the index table itself , If an index is monitored, it is often used , So it's considered thermal data , Then create an internal hash Indexes ( Applicable only “=” Query for , Yes “in”“<=>” These range queries do not apply )
3. Created hash After index , If this index is queried next time , Then go straight through hash The algorithm deduces the address of the record , You can find the data directly at once , Than repeat B+tree The efficiency of querying nodes three or four times in the index is much higher
buffer pool solve : Pre read failure , Buffer contamination
版权声明
本文为[Anxious two dogs]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231228313354.html
边栏推荐
- 天梯赛赛前练习
- Lesson 23 temporary objects
- Lesson 24 analysis of classical problems
- STM32控制步进电机(ULN2003+28byj)
- Symmetric encryption, certificate encryption
- NativeForMySQL 连接MySQL8 提示:1251- Client does not support authentication protocol
- 力扣刷题之完全二叉树的节点个数
- IDEA 代码格式化插件Save Actions
- Introduction to metalama 4 Use fabric to manipulate items or namespaces
- Metalama简介4.使用Fabric操作项目或命名空间
猜你喜欢
随机推荐
Flash project cross domain interception and DBM database learning [Baotou cultural and creative website development]
第二十四课 经典问题解析
网络信息安全之零信任
Idea setting copyright information
[redis series] redis learning 13. Redis often asks simple interview questions
如何防止网站被黑客入侵篡改
为什么hash%length==hash&(length-1)的前提是 length 是 2 的 n 次方
QT draw image
flask项目跨域拦截处理以及dbm数据库学习【包头文创网站开发】
NPDP|产品经理如何做到不会被程序员排斥?
【Redis 系列】redis 学习十三,Redis 常问简单面试题
IDEA 数据库插件Database Navigator 插件
Running error: unable to find or load the main class com xxx. Application
外包干了五年,废了...
IDEA设置版权信息
【unity笔记】L4Unity中的基础光照
画结果图推荐网址
C#,二维贝塞尔拟合曲线(Bézier Curve)参数点的计算代码
欣旺达宣布电池产品涨价 此前获“蔚小理”投资超10亿
CGC: contractual graph clustering for community detection and tracking









