It is very difficult to find a single value from a large database by following complete tree traversals with multiple levels. To overcome this problem, MySQL has provided another index type, which is known as a hash index. This index creates a hash table rather than a tree, which is very flat in structure compared to a B-Tree index. Hashing mainly uses hash functions to generate the addresses of data. Two important terms related to hashing are:
- Hash function: The mapping function which will be useful to map search-keys with the address where actual records are stored.
- Bucket: A bucket is a unit of storage where a hash index stores the data. A bucket indicates a complete disk block, which will store one or more records.
Along with the hashing mechanism, a hash index has some special characteristics, described as follows:
- The whole key is used to search the row. While...