📅  最后修改于: 2023-12-03 15:01:24.641000             🧑  作者: Mango
InnoDB is a storage engine used by MySQL and MariaDB. InnoDB Adaptive Hash Index is a feature that intelligently manages the InnoDB buffer pool and speeds up lookups.
InnoDB Adaptive Hash Index is a data structure that enables rapid lookups in large datasets. It uses an in-memory hash table to cache frequently accessed index pages. When a page is accessed frequently, it is added to the hash table. This allows future lookups to be performed quickly without the need to access the disk.
The adaptive aspect of the feature comes into play when the size of the hash table is adjusted based on changing workload patterns. When dataset characteristics change, the hash index will automatically adjust its size to optimize performance.
The InnoDB Adaptive Hash Index provides several benefits, including:
InnoDB Adaptive Hash Index is enabled by default. However, it can be disabled or adjusted by changing the "innodb_adaptive_hash_index" system variable.
To disable adaptive hash index, set "innodb_adaptive_hash_index" to "0":
SET GLOBAL innodb_adaptive_hash_index = 0;
To adjust the size of the hash index, set "innodb_adaptive_hash_index_parts":
SET GLOBAL innodb_adaptive_hash_index_parts = 16;
The InnoDB Adaptive Hash Index is a powerful feature that provides faster lookups, reduced I/O requests, and efficient memory usage. It's worth enabling and adjusting the feature according to your workload patterns to optimize performance.