Akiyu

关于 Mysql InnoDB 默认索引类型...

  •  
  •   Akiyu · Sep 15, 2020 · 2337 views
    This topic created in 2098 days ago, the information mentioned may be changed or developed.

    我之前一直看 Mysql 的 官方文档. 所以我一直认为是 InnoDB 的索引默认类型是 B-tree.
    (我还记得之前有次面试问我默认类型的时候, 我斩钉截铁说是 B-tree 时. 面试官楞了一下, 然后重复问了一次...)
    但是今天突然在某处看到有人讨论 Mysql InnoDB 默认索引类型为什么是 B+tree. 并且下面的回复都没有质疑索引类型正确性... 我突然感觉自己错了.
    然后我 google 了一下. 搜索结果

    ......

    这... 感觉自己被官方欺骗了...

    我一直视官方文档为第一权威资料. 但这件事可能会让我重新审视一下...

    9 replies    2020-09-17 01:02:07 +08:00
    FutherAll
        1
    FutherAll  
       Sep 15, 2020 via iPhone
    官方说的 B-tree 可能是指的 B tree 这一类树,B+ tree 是它的一个变种。
    sangbiao
        2
    sangbiao  
       Sep 15, 2020
    愣了不是因为 b-tree 还是 b+tree,而是你根本答非所问啊大哥!
    索引类型是普通索引组合索引单列索引啥的
    b-tree 、b+tree 那是索引的数据结构
    sangbiao
        3
    sangbiao  
       Sep 15, 2020
    @tgich 还有啥是默认索引类型?
    chihiro2014
        4
    chihiro2014  
       Sep 15, 2020
    无论是 B-Tree 也好还是 B+Tree 也好,说的都是对的。因为 B+Tree 早就不是一开始的那个 B+Tree 了,融合了 B-Tree 很多其他变种的特点
    chihiro2014
        5
    chihiro2014  
       Sep 15, 2020   ❤️ 1
    其实很多数据库对于这个描述也是模糊的,但是你可以认为用的都是 B+Tree
    FutherAll
        6
    FutherAll  
       Sep 15, 2020   ❤️ 1
    ```
    The use of the term B-tree is intended as a reference to the general class of index design. B-tree structures used by MySQL storage engines may be regarded as variants due to sophistications not present in a classic B-tree design.
    ```
    bluehr
        7
    bluehr  
       Sep 15, 2020
    打个岔,楼主不会念成了 b 减 tree 吧(没有其他意思,曾经我以为 btree b-tree b+tree 是三种不同的树,闹笑话了)
    Akiyu
        8
    Akiyu  
    OP
       Sep 16, 2020
    @bluehr
    哈哈哈, 怎么会, 中间那个 - 只是为了分隔. 不变成 btree 而已.
    zagfai
        9
    zagfai  
       Sep 17, 2020
    那个是 hyphen 不是 minus 吧 哈哈哈
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2871 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 08:13 · PVG 16:13 · LAX 01:13 · JFK 04:13
    ♥ Do have faith in what you're doing.