MySQL 使用的是 BTree 还是 B+Tree
MySQL B树 B+树 大约 1192 字查看索引
查看表account
的索引。
show index from account;
输出:
mysql> show index from account;
+---------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+---------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| account | 0 | PRIMARY | 1 | id | A | 3 | NULL | NULL | | BTREE | | |
+---------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
1 row in set (0.00 sec)
为什么是 BTREE
Index_type
上显示的虽然是BTREE
,但MySQL
底层确实是用的B+Tree
,外国友人猜测的可能原因:
B+TREE
不是一个很好的关键词,+
号是一个操作符。- 语法比
InnoDB
还早,可能比ISAM
还早。
注意
B+Tree
也是一种BTree
啊!
参考
https://dba.stackexchange.com/questions/204561/does-mysql-use-b-tree-btree-or-both/204573
https://blog.jcole.us/2013/01/10/btree-index-structures-in-innodb
阅读 2435 · 发布于 2021-03-10
————        END        ————
Give me a Star, Thanks:)
https://github.com/fendoudebb扫描下方二维码关注公众号和小程序↓↓↓

昵称:
随便看看
换一批
-
JavaScript 闭包阅读 1141
-
Spring Boot 实现 SSE 服务端推送事件阅读 1229
-
软考-系统架构设计师:系统运行与维护阅读 1796
-
IDEA 使用 Swing Explorer 调试 Swing 和 AWT阅读 1901
-
Windows 平台 lua-resty-upload 上传的文件无法打开阅读 1686
-
Redis 执行 Lua 脚本抛出 StatusOutput does not support set(long) 异常阅读 7291
-
Spring Boot 防重放攻击原理及代码实现阅读 302
-
使用 ffmpeg 转换 m4a 为 mp3阅读 5426
-
Linux 编译安装 PostgreSQL阅读 1459
-
软考-系统架构设计师:大数据阅读 1123