mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
MDEV-20487 Set innodb_adaptive_hash_index=OFF by default
Based on the performance testing that was conducted in MDEV-17492, the InnoDB adaptive hash index could only help performance in specific, almost-read-only workloads. It could slow down all kinds of workloads (especially DROP TABLE, TRUNCATE TABLE, ALTER TABLE, or DROP INDEX operations), and it can become corrupted, causing crashes (such as MDEV-18815, MDEV-20203) and possibly data corruption. Furthermore, the adaptive hash index consumes space from the InnoDB buffer pool, which could hurt performance when the working set would almost fit in the buffer pool. Given all this, it is best to disable the adaptive hash index by default.
This commit is contained in:
@@ -1239,11 +1239,10 @@ struct my_option xb_server_options[] =
|
||||
GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#ifdef BTR_CUR_HASH_ADAPT
|
||||
{"innodb_adaptive_hash_index", OPT_INNODB_ADAPTIVE_HASH_INDEX,
|
||||
"Enable InnoDB adaptive hash index (enabled by default). "
|
||||
"Disable with --skip-innodb-adaptive-hash-index.",
|
||||
"Enable InnoDB adaptive hash index (disabled by default).",
|
||||
&btr_search_enabled,
|
||||
&btr_search_enabled,
|
||||
0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
|
||||
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#endif /* BTR_CUR_HASH_ADAPT */
|
||||
{"innodb_autoextend_increment", OPT_INNODB_AUTOEXTEND_INCREMENT,
|
||||
"Data file autoextend increment in megabytes",
|
||||
|
||||
@@ -35,10 +35,10 @@ READ_ONLY NO
|
||||
COMMAND_LINE_ARGUMENT REQUIRED
|
||||
VARIABLE_NAME INNODB_ADAPTIVE_HASH_INDEX
|
||||
SESSION_VALUE NULL
|
||||
DEFAULT_VALUE ON
|
||||
DEFAULT_VALUE OFF
|
||||
VARIABLE_SCOPE GLOBAL
|
||||
VARIABLE_TYPE BOOLEAN
|
||||
VARIABLE_COMMENT Enable InnoDB adaptive hash index (enabled by default). Disable with --skip-innodb-adaptive-hash-index.
|
||||
VARIABLE_COMMENT Enable InnoDB adaptive hash index (disabled by default).
|
||||
NUMERIC_MIN_VALUE NULL
|
||||
NUMERIC_MAX_VALUE NULL
|
||||
NUMERIC_BLOCK_SIZE NULL
|
||||
|
||||
@@ -18744,9 +18744,8 @@ static MYSQL_SYSVAR_BOOL(stats_traditional, srv_stats_sample_traditional,
|
||||
#ifdef BTR_CUR_HASH_ADAPT
|
||||
static MYSQL_SYSVAR_BOOL(adaptive_hash_index, btr_search_enabled,
|
||||
PLUGIN_VAR_OPCMDARG,
|
||||
"Enable InnoDB adaptive hash index (enabled by default). "
|
||||
" Disable with --skip-innodb-adaptive-hash-index.",
|
||||
NULL, innodb_adaptive_hash_index_update, true);
|
||||
"Enable InnoDB adaptive hash index (disabled by default).",
|
||||
NULL, innodb_adaptive_hash_index_update, false);
|
||||
|
||||
/** Number of distinct partitions of AHI.
|
||||
Each partition is protected by its own latch and so we have parts number
|
||||
|
||||
Reference in New Issue
Block a user