当前位置:网站首页>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
边栏推荐
- Is Shengang securities company as safe as other securities companies
- 51 single chip microcomputer timer 2 is used as serial port
- How programmers find girlfriends through blind dates
- Pesticide synergist - current market situation and future development trend
- C import Xls data method summary I (upload files and create Workbooks)
- Jerry's watch information type table [chapter]
- Life cycle of instance variables, static variables and local variables
- How to subcontract uniapp and applet, detailed steps (illustration) # yyds dry goods inventory #
- Logical operator, displacement operator
- Jerry's modification setting status [chapter]
猜你喜欢
2020-12-02 SSM advanced integration Shang Silicon Valley
Chapter 3.4: starrocks data import - Flink connector and CDC second level data synchronization
Conditional statements of shell programming
Applet graduation project is based on wechat classroom laboratory reservation applet graduation project opening report function reference
Save Private Ryan - map building + voltage dp+deque+ shortest circuit
When tidb meets Flink: tidb efficiently enters the lake "new play" | tilaker team interview
LeetCode 168. Detailed explanation of Excel list name
Openbionics robot project introduction | bciduino community finishing
Introduction to superresolution
How programmers find girlfriends through blind dates
随机推荐
Jerry's watch information type table [chapter]
[leetcode daily question] a single element in an ordered array
Pesticide synergist - current market situation and future development trend
It's corrected. There's one missing < /script >, why doesn't the following template come out?
Why can't it run (unresolved)
From the 18th line to the first line, the new story of the network security industry
Conditional statements of shell programming
Gnupg website
Huawei cloud micro certification Huawei cloud computing service practice has been stable
Intel's new GPU patent shows that its graphics card products will use MCM Packaging Technology
I don't know why it can't run in the project and how to change it
LV1 Roche limit
MySQL statement learning record
G3 boiler water treatment registration examination and G3 boiler water treatment theory examination in 2022
Valentine's Day - 9 jigsaw puzzles with deep love in wechat circle of friends
51 single chip microcomputer timer 2 is used as serial port
Conditional test, if, case conditional test statements of shell script
On Valentine's day, I code a programmer's exclusive Bing Dwen Dwen (including the source code for free)
Skku| autonomous handover decision of UAV Based on deep reinforcement learning
Lightweight Pyramid Networks for Image Deraining