Performance Improvements and Caveats of MySQL InnoDB Adaptive Hash Index
Key point
Test results showed CPU usage dropping from 100% to 60% and throughput increasing from 20,000 to 37,000.
Details
MySQL InnoDB's Adaptive Hash Index stores frequently accessed data in a hash to bypass B-Tree lookups. It reduces the O(logN) access cost of B-Trees to O(1) for hashes, mitigating Mutex Lock delays.
Performance Impact
In an environment with 13 million records, executing PK-based IN queries resulted in CPU usage dropping from 100% to 60% when AHI was enabled. Query response times decreased, increasing throughput from 20,000 to 37,000, and Semaphore waits were significantly reduced.
Operational Caveats
AHI can be dynamically controlled via the innodb_adaptive_hash_index parameter, but its unpredictable memory usage makes monitoring essential. In particular, hash data for tables unused for several months may remain in memory, potentially causing a sharp drop in query throughput when those tables are dropped. Therefore, table cleanup operations should be performed during low-traffic periods.
This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.
Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.