Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
Description
The InnoDB adaptive hash index is sometimes degrading the performance of InnoDB, and it is sometimes disabled to get more consistent performance. We should have a compile-time option to disable the adaptive hash index.
Let us introduce two options:
OPTION(WITH_INNODB_AHI "Include innodb_adaptive_hash_index" ON)
|
OPTION(WITH_INNODB_ROOT_GUESS "Cache index root block descriptors" ON)
|
IF(WITH_INNODB_AHI)
|
ADD_DEFINITIONS(-DBTR_CUR_HASH_ADAPT -DBTR_CUR_ADAPT)
|
IF(NOT WITH_INNODB_ROOT_GUESS)
|
MESSAGE(WARNING "WITH_INNODB_AHI implies WITH_INNODB_ROOT_GUESS")
|
ENDIF()
|
ELSEIF(WITH_INNODB_ROOT_GUESS)
|
ADD_DEFINITIONS(-DBTR_CUR_ADAPT)
|
ENDIF()
|
And let us consistently enclose all dependent code in appropriate #ifdef.
As part of this change, the misleadingly named function trx_search_latch_release_if_reserved(trx) will be replaced with the macro trx_assert_no_search_latch(trx) that will be empty unless BTR_CUR_HASH_ADAPT is defined (cmake -DWITH_INNODB_AHI=ON).
We will remove the unused column INFORMATION_SCHEMA.INNODB_TRX.TRX_ADAPTIVE_HASH_TIMEOUT.
In MariaDB Server 10.1, it used to reflect the value of trx_t::search_latch_timeout which could be adjusted during row_search_for_mysql(). In 10.2, there is no such field.
Apart from the removal of the unused column, this is an almost non-functional change to the server when using the default build options, because WITH_INNODB_AHI will be ON by default.
Attachments
Issue Links
- causes
-
MDEV-14441 InnoDB hangs when setting innodb_adaptive_hash_index=OFF during UPDATE
- Closed
- relates to
-
MDEV-20487 Set innodb_adaptive_hash_index=OFF by default
- Closed
-
MDEV-17492 Benchmark AHI to find cases where it's useful
- Stalled