当前位置:网站首页>Advanced learning of MySQL -- Application -- index
Advanced learning of MySQL -- Application -- index
2022-07-04 01:59:00 【Magic pig 9898】
install Linux Version of mysql
System : centOS7
msyql: 8.0.26
Index Overview
An index is an ordered data structure
Can help MySQL Efficient data acquisition .
That means : In the database table structure , In addition to saving data , The database also needs to maintain the data structure of index , Use these structures to point to the saved data . In this way, advanced search algorithms can be used in these data structures , Quickly locate the original data .

Index structure
MySQL The index of is implemented in the storage engine layer , Different storage engines have different structures , It mainly includes the following :
Binary tree index structure

improvement :

B-tree Index structure
Take a maximum degree as 5 Of b-tree For example ( Each node can store up to 4 individual key, 5 A pointer to the )
B+tree Index structure
All elements are only in leaf nodes , Those above are just for indexing .
Leaf nodes form a one-way linked list .

Hash Index structure

hsah Features of index :
It can only be used for peer-to-peer comparison , Range query is not supported ;
Cannot sort with index ;
Query efficiency is higher than B+tree;
stay mysql in , Support hash The indexing engine is , memory engine , and InnoDB It has adaptive function hash function , hash The index is the storage engine B+tree Automatically built under specified conditions .
Why B+tree

Index classification






Summary

You can find , Innodb Even if the table stores more than 20 million records , It's only three floors . Efficiency is very high .
If there are hundreds of millions of records , Then we have to consider the sub database and sub table ~
Index Syntax
SQL Performance analysis
Index usage
Index design principles
边栏推荐
- Development of user-defined navigation bar in uniapp
- Setting function of Jerry's watch management device [chapter]
- Question C: Huffman tree
- How can enterprises optimize the best cost of cloud computing?
- Solution to the problem that jsp language cannot be recognized in idea
- How programmers find girlfriends through blind dates
- The automatic control system of pump station has powerful functions and diverse application scenarios
- Gnupg website
- Is Shengang securities company as safe as other securities companies
- Feign implements dynamic URL
猜你喜欢

Small program graduation design is based on wechat order takeout small program graduation design opening report function reference

Pytoch residual network RESNET

LeetCode 168. Detailed explanation of Excel list name

Three layer switching ②

Applet graduation design is based on wechat course appointment registration. Applet graduation design opening report function reference

Write the first CUDA program

Mysql-15 aggregate function

Force buckle day32

Iclr2022 | ontoprotein: protein pre training integrated with gene ontology knowledge

Final consistency of MESI cache in CPU -- why does CPU need cache
随机推荐
Ceramic metal crowns - current market situation and future development trend
Development of user-defined navigation bar in uniapp
Setting function of Jerry's watch management device [chapter]
What are the main investment products of bond funds and what are they
JVM performance tuning and practical basic theory - medium
Sequence sorting of basic exercises of test questions
Idsia & supsi & usi | continuous control behavior learning and adaptive robot operation based on Reinforcement Learning
Portapack application development tutorial (XVII) nRF24L01 launch C
LV1 previous life archives
Remember another interview trip to Ali, which ends on three sides
Maximum likelihood method, likelihood function and log likelihood function
Life cycle of instance variables, static variables and local variables
MySQL advanced SQL statement (1)
Remember a lazy query error
Introduction to graphics: graphic painting (I)
求esp32C3板子連接mssql方法
Meta metauniverse female safety problems occur frequently. How to solve the related problems in the metauniverse?
Cancer biopsy instruments and kits - market status and future development trends
Solution of cursor thickening
Save Private Ryan - map building + voltage dp+deque+ shortest circuit