当前位置:网站首页>MySQL review
MySQL review
2022-06-12 12:06:00 【Star field_ 03zhan】
List of articles
Mind mapping :
server layer :
Index failure :
Concurrency issues :
Transaction characteristics and isolation levels ?
Talk to you about B+ Understanding of trees ?
I have learned that B+ The tree is because it is InnoDB Index of storage engine .
stay InnoDB in ,B+ Each node in the tree is a data page , A directory of pages stored in a data page , Maximum record, minimum record and other information .
B+ The tree only stores data in the leaf node , Other non leaf nodes store directories as indexes .
Its non leaf nodes are divided into different levels , Reduce the amount of search in each layer by layering .
And all its nodes are sorted by index value size , Form a two-way linked list , Easy range query .
Why? InnoDB Use B+ Trees , Instead of using B Trees ?
B Each node of the tree contains data and indexes ,B+ Only leaf nodes in the tree contain data , There are only indexes in non leaf nodes . Such a structure ,B+ The non leaf nodes of the tree can store more indexes , With the same amount of data . This will make B+ Tree ratio B The trees are fatter , The number of layers of the tree is related to the disk I/O Number of visits , The shorter the tree , The fewer visits , by comparison ,B+ Trees can reduce the number of disks I/O Number of visits , Increase of efficiency .
B+ The tree has a large number of redundant nodes ( All non leaf nodes are redundant indexes ), During delete and insert operations , Don't like B A complex deformation of a tree occurs like a tree
B+ The leaf nodes of the tree are connected by linked lists , Conducive to range query , and B The tree does not use linked list connection , Not conducive to range query , To implement a range query , You have to traverse the whole tree , This designs disks with multiple nodes I/O operation , Reduced efficiency .
Talk about your understanding of clustering index ?
Cluster index means that the leaf nodes of the tree store actual data , A table can only have one clustered index .
Clustered indexes usually select the primary key column as the index key , If there is no primary key , Then select the first column without null value and with unique constraint as the index key , If none of the above two situations ,InnoDB An implicit id Automatic column as index key .
Talk about your understanding of secondary index ?
A secondary index is also called a nonclustered index , Its leaf nodes do not store actual data , Is the primary key value .
A table can have multiple secondary indexes .
When querying the secondary index , If you want to query the primary key value , You only need to query the secondary index , Just need to query one tree B+ Trees . This does not require querying the clustered index , This is also called Index overlay . But if you want to query the actual data , You need to query the secondary index , Then query the cluster index , Query the desired data in the clustered index according to the primary key value obtained from the secondary index query . You need to query two B+ Trees , This is also called Back to the table .
边栏推荐
- Chapter VI data type (V)
- Ficusjs series (I) introduction to ficusjs
- Batch load/store instructions of arm instruction set
- bind、call、apply三者的区别,还有bind()的封装
- Channel shuffle class
- 开源项目-(ERP+酒店+电商)后台管理系统
- DOM+JS+轮播图+无时间
- [foundation of deep learning] back propagation method (1)
- Longest string without duplicate characters (leetcode 3)
- Rich text editor copying pictures in word documents
猜你喜欢

Find the median of two ordered arrays (leetcode 4)

QML学习 第一天

JS to load and display Excel files

导航中,添加边框影响布局的解决方法

Ros- resolve error "tf2\u buffer\was not declared in this scope"

Compiling Draco library on Windows platform

无重复字符的最长字符串(LeetCode 3)

LeetCode 890. Find and replace mode (analog + double hash table)

視頻分類的類間和類內關系——正則化

mysql复习
随机推荐
Miscellaneous instructions of arm instruction set
Asynchronous path processing
LeetCode 497. Random points in non overlapping rectangles (prefix and + bisection)
QT adds a summary of the problems encountered in the QObject class (you want to use signals and slots) and solves them in person. Error: undefined reference to `vtable for xxxxx (your class name)‘
Why is there no traffic after the launch of new products? How should new products be released?
无重复字符的最长字符串(LeetCode 3)
导航中,添加边框影响布局的解决方法
必杀技--使用FFmpeg命令快速精准剪切视频
为什么新品发布上架之后会没有流量,新品应该怎么发布?
Getting started with NVIDIA Jetson nano Developer Kit
PIP install in the CONDA environment cannot be installed into the specified CONDA environment (the default PIP installation location of the CONDA environment)
传统的DOM渲染方式?
开源项目-(ERP+酒店+电商)后台管理系统
【QNX Hypervisor 2.2 用户手册】4.1 构建QNX Hypervisor系统的方法
LeetCode_二分搜索_中等_162. 寻找峰值
Google Earth engine (GEE) - quick land classification by kmeans clustering (double for loop quick parameter adjustment)
this的指向
LeetCode 1037. 有效的回旋镖(向量叉乘)
Automatic generation of folder directory structure
Spark common encapsulation classes