B-Tree vs Hash Table

后端 未结 5 572
轻奢々
轻奢々 2020-12-22 16:32

In MySQL, an index type is a b-tree, and access an element in a b-tree is in logarithmic amortized time O(log(n)).

On the other hand, accessing an eleme

5条回答
  •  隐瞒了意图╮
    2020-12-22 17:18

    Actually, it seems that MySQL uses both kind of indexes either a hash table or a b-tree according to the following link.

    The difference between using a b-tree and a hash table is that the former allows you to use column comparisons in expressions that use the =, >, >=, <, <=, or BETWEEN operators, while the latter is used only for equality comparisons that use the = or <=> operators.

提交回复
热议问题