当前位置:网站首页>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
边栏推荐
- Mysql-15 aggregate function
- Yyds dry goods inventory it's not easy to say I love you | use the minimum web API to upload files
- Chain ide -- the infrastructure of the metauniverse
- MySQL advanced SQL statement (1)
- Customize redistemplate tool class
- Jerry's modification setting status [chapter]
- MySQL statement learning record
- G3 boiler water treatment registration examination and G3 boiler water treatment theory examination in 2022
- Install the pit that the electron has stepped on
- Why can't it run (unresolved)
猜你喜欢

What is the student party's Bluetooth headset recommendation? Student party easy to use Bluetooth headset recommended

Lightweight Pyramid Networks for Image Deraining

Conditional statements of shell programming

Introduction to superresolution

MySQL statement learning record

Override and virtual of classes in C #

When tidb meets Flink: tidb efficiently enters the lake "new play" | tilaker team interview

LeetCode226. Flip binary tree

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

Yyds dry goods inventory hand-in-hand teach you the development of Tiktok series video batch Downloader
随机推荐
TP5 automatic registration hook mechanism hook extension, with a complete case
Bacteriostatic circle scanning correction template
A. Div. 7
Question d: Haffman coding
LV1 previous life archives
Maximum likelihood method, likelihood function and log likelihood function
Pytoch residual network RESNET
Applet graduation project based on wechat selection voting applet graduation project opening report function reference
The reasons why QT fails to connect to the database and common solutions
Infiltration learning diary day19
Development of user-defined navigation bar in uniapp
Introduction to graphics: graphic painting (I)
Push technology practice | master these two tuning skills to speed up tidb performance a thousand times!
Write the first CUDA program
Example 073 square sum value judgment programming requires the input of a and B, if a ²+ b ² If the result of is greater than 100, a is output ²+ b ² Value, otherwise output the result of a + B.
Force buckle day32
Mysql-15 aggregate function
When tidb meets Flink: tidb efficiently enters the lake "new play" | tilaker team interview
[typora installation package] old typera installation package, free version
Life cycle of instance variables, static variables and local variables