当前位置:网站首页>Differences between MySQL BTREE index and hash index
Differences between MySQL BTREE index and hash index
2022-04-23 16:18:00 【It worker】
In the use of MySQL When indexing , choice b-tree still hash
hash Index can only satisfy "=","IN" and "<=>" Inquire about , Can't use range query . such as < , because Hash Index comparison is to carry out Hash After the operation Hash value , So it can only be used for equivalent filtering , Can't be used for range based filtering , Because after the corresponding Hash After algorithm processing Hash The relationship between the size of the value , There's no guarantee of and Hash It's exactly the same before the operation
For composite indexes ,Hash The index is calculating Hash When the value is combined, the index key is combined and then calculated together Hash value , Not separately Hash value , So when you query by combining one or more index keys in front of the index ,Hash Index can't be used
Hash Index is to pass the index key through Hash After the operation , take Hash The result of the calculation Hash The value and the corresponding row pointer information are stored in a Hash In the table , Because different index keys are the same Hash value , So even if you meet someone Hash Number of records of key value data , I can't go from Hash Direct query in index , You still need to access the actual data in the table for corresponding comparison , And get the corresponding result
Hash Index encountered a lot of Hash When the values are equal, the performance is not necessarily better than B-Tree High index .
B-Tree The index can be used in images =,>,>=,<,<= and BETWEEN On these comparison operators . And it can also be used for LIKE The operator , As long as its query condition is a constant that does not start with a wildcard
innodb and myisam The storage engine cannot be used hash Indexes .........
版权声明
本文为[It worker]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231607305039.html
边栏推荐
- 捡起MATLAB的第(9)天
- Tencent offer has been taken. Don't miss the 99 algorithm high-frequency interview questions. 80% of them are lost in the algorithm
- How can poor areas without networks have money to build networks?
- Solution to the fourth "intelligence Cup" National College Students' IT skills competition (group B of the final)
- MySQL - MySQL查询语句的执行过程
- Unity shader learning
- 最詳細的背包問題!!!
- 5 minutes, turn your excel into an online database, the magic cube net table Excel database
- Nacos 详解,有点东西
- Unity Shader学习
猜你喜欢

TIA botu - basic operation

ESP32编译环境的搭建

力扣-198.打家劫舍

Interview question 17.10 Main elements

Function summary of drawing object arrangement in R language

Sail soft calls the method of dynamic parameter transfer and sets parameters in the title

Hyperbdr cloud disaster recovery v3 Release of version 3.0 | upgrade of disaster recovery function and optimization of resource group management function

Ice -- source code analysis

Countdown 1 day ~ 2022 online conference of cloud disaster tolerance products is about to begin

Six scenarios of cloud migration
随机推荐
How to conduct application security test (AST)
捡起MATLAB的第(10)天
ES常用查询、排序、聚合语句
Sail soft calls the method of dynamic parameter transfer and sets parameters in the title
There is a problem with the light switch from 1 to 100
Cloud migration practice in the financial industry Ping An financial cloud integrates hypermotion cloud migration solution to provide migration services for customers in the financial industry
The solution of not displaying a whole line when the total value needs to be set to 0 in sail software
保姆级Anaconda安装教程
js正则判断域名或者IP的端口路径是否正确
Nacos 详解,有点东西
Nanny Anaconda installation tutorial
Report FCRA test question set and answers (11 wrong questions)
Day (5) of picking up matlab
Es common query, sorting and aggregation statements
Force buckle-746 Climb stairs with minimum cost
Hyperbdr cloud disaster recovery v3 Version 2.1 release supports more cloud platforms and adds monitoring and alarm functions
基于GPU实例的Nanopore数据预处理
Win11 / 10 home edition disables the edge's private browsing function
捡起MATLAB的第(3)天
Function summary of drawing object arrangement in R language