title: B-Tree vs Hash Table
body: <p>In MySQL, an index type is a b-tree, and access an element in a b-tree is in logarithmic amortized time <code>O(log(n))</code>.</p>
  
  <p>On the other hand, accessing an element in a hash table is in <code>O(1)</code>.</p>
  
  <p>Why is a hash table not used instead of a b-tree in order to access data inside a database?</p>