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
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.