当前位置:网站首页>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
边栏推荐
- js正則判斷域名或者IP的端口路徑是否正確
- Tencent offer has been taken. Don't miss the 99 algorithm high-frequency interview questions. 80% of them are lost in the algorithm
- Day 10 abnormal mechanism
- Solution to the fourth "intelligence Cup" National College Students' IT skills competition (group B of the final)
- Leetcode-374 guess the size of the number
- Nanny Anaconda installation tutorial
- 面试题 17.10. 主要元素
- MySQL - execution process of MySQL query statement
- 捡起MATLAB的第(4)天
- VMware Workstation cannot connect to the virtual machine. The system cannot find the specified file
猜你喜欢
Groupby use of spark operator
糖尿病眼底病变综述概要记录
Day (6) of picking up matlab
Force buckle-746 Climb stairs with minimum cost
Sail soft calls the method of dynamic parameter transfer and sets parameters in the title
Summary according to classification in sail software
matplotlib教程05---操作图像
Research and Practice on business system migration of a government cloud project
Nanny Anaconda installation tutorial
Day (4) of picking up matlab
随机推荐
深度学习100例 | 第41天-卷积神经网络(CNN):UrbanSound8K音频分类(语音识别)
[section 5 if and for]
捡起MATLAB的第(4)天
The most detailed knapsack problem!!!
Meaning and usage of volatile
What does cloud disaster tolerance mean? What is the difference between cloud disaster tolerance and traditional disaster tolerance?
JMeter setting environment variable supports direct startup by entering JMeter in any terminal directory
力扣-198.打家劫舍
The solution of not displaying a whole line when the total value needs to be set to 0 in sail software
最詳細的背包問題!!!
第十天 异常机制
5 minutes, turn your excel into an online database, the magic cube net table Excel database
Review 2021: how to help customers clear the obstacles in the last mile of going to the cloud?
Day (3) of picking up matlab
Unity Shader学习
Download and install mongodb
保姆级Anaconda安装教程
Vision of building interstellar computing network
Day 10 abnormal mechanism
How to upgrade openstack across versions