From 830b39c89847baca27ee4d44dc2741ce3d5ffb8c Mon Sep 17 00:00:00 2001 From: Mohammad Tafzeel Shams Date: Wed, 13 May 2026 10:13:03 +0530 Subject: [PATCH] MDEV-38305: Expose adaptive hash index statistics in ANALYZE FORMAT=JSON Expose InnoDB's Adaptive Hash Index (AHI) statistics through ANALYZE FORMAT=JSON output and global status variables to provide query-level and system-level visibility into AHI usage and effectiveness. This allows DBAs and developers to monitor how well the adaptive hash index is serving their workloads on a per-query basis. The r_ahi_stats object (nested inside r_engine_stats) now reports four key metrics: ahi_searches (successful AHI lookups), ahi_searches_btree (AHI misses requiring B-tree fallback), ahi_rows_added (rows inserted into AHI), and ahi_pages_added (pages indexed by AHI). These same metrics are exposed globally via innodb_status_variables. Transaction-local tracking eliminates contention by accumulating statistics in trx_t fields (n_sea, n_non_sea, n_ahi_rows_added, n_ahi_pages_added) and aggregating them into global atomic counters (btr_cur_n_sea, btr_cur_n_non_sea, btr_ahi_n_rows_added, btr_ahi_n_pages_added) during trx_t::commit_cleanup() and trx_t::free(), following the pattern established for buf_pool.stat.n_page_gets. - btr_ahi_inc_searches(): Increment trx->n_sea when AHI lookup succeeds. - btr_ahi_inc_searches_btree(): Increment trx->n_non_sea when AHI lookup fails and falls back to B-tree search. - btr_ahi_inc_rows_added(): Increment trx->n_ahi_rows_added when rows are added to the adaptive hash index structure. - btr_ahi_inc_pages_added(): Increment trx->n_ahi_pages_added when new pages are indexed by AHI. - btr_cur_t::search_leaf(): Call btr_ahi_inc_searches() on successful AHI hit and btr_ahi_inc_searches_btree() on AHI miss. - btr_cur_n_sea, btr_cur_n_non_sea: Replace sharded ib_counter_t with simple atomic counters. - MONITOR_OVLD_ADAPTIVE_HASH_ROW_ADDED, MONITOR_OVLD_ADAPTIVE_HASH_PAGE_ADDED: Convert monitor counters to "overload" type that read from global atomic counters btr_ahi_n_rows_added and btr_ahi_n_pages_added respectively instead of maintaining separate statistics. - trace_engine_stats(): Output r_ahi_stats object with all four AHI counters in JSON format when any AHI activity is detected during query execution. - ha_handler_stats: Added ahi_searches, ahi_searches_btree, ahi_rows_added, and ahi_pages_added fields to track per-query AHI statistics. - Add mtr parameter to btr_search_move_or_delete_hash_entries(), btr_cur_t::search_info_update(), btr_search_update_hash_on_insert(), btr_search_update_hash_ref(), btr_search_info_update_hash(), and btr_search_build_page_hash_index() to allow updating AHI statistics. - ahi_stats.test: Comprehensive verification of AHI statistics reporting across different scenarios: insufficient accesses (no AHI build), threshold triggering (AHI construction), heavy warmup (full AHI utilization), and disabled AHI (verify zero statistics). - check_ahi_status.inc: Reusable include file for executing queries with configurable warmup repetitions and extracting AHI statistics from ANALYZE FORMAT=JSON output using JSON path expressions. --- mysql-test/include/analyze-format.inc | 2 +- mysql-test/main/rowid_filter_innodb,ahi.rdiff | 40 +++++++++- .../suite/innodb/include/check_ahi_status.inc | 45 +++++++++++ mysql-test/suite/innodb/r/ahi_stats.result | 30 +++++++ .../r/innodb_skip_innodb_is_tables.result | 4 +- .../innodb/r/innodb_status_variables.result | 2 + mysql-test/suite/innodb/t/ahi_stats.test | 78 +++++++++++++++++++ sql/ha_handler_stats.h | 5 ++ sql/sql_explain.cc | 14 ++++ storage/innobase/btr/btr0btr.cc | 8 +- storage/innobase/btr/btr0cur.cc | 38 +++++++-- storage/innobase/btr/btr0sea.cc | 61 ++++++++++----- storage/innobase/handler/ha_innodb.cc | 2 + storage/innobase/include/btr0cur.h | 12 ++- storage/innobase/include/btr0sea.h | 16 ++-- storage/innobase/include/srv0mon.h | 4 +- storage/innobase/include/srv0srv.h | 2 + storage/innobase/include/trx0trx.h | 10 +++ storage/innobase/page/page0page.cc | 4 +- storage/innobase/srv/srv0mon.cc | 18 ++++- storage/innobase/srv/srv0srv.cc | 2 + storage/innobase/trx/trx0trx.cc | 25 +++--- .../r/innodb_i_s_tables_disabled.result | 4 +- 23 files changed, 359 insertions(+), 67 deletions(-) create mode 100644 mysql-test/suite/innodb/include/check_ahi_status.inc create mode 100644 mysql-test/suite/innodb/r/ahi_stats.result create mode 100644 mysql-test/suite/innodb/t/ahi_stats.test diff --git a/mysql-test/include/analyze-format.inc b/mysql-test/include/analyze-format.inc index 134905d4410dd..59251818d0e94 100644 --- a/mysql-test/include/analyze-format.inc +++ b/mysql-test/include/analyze-format.inc @@ -4,4 +4,4 @@ # - r_engine_stats depends on buffer pool state and whether old record versions # were purged. ---replace_regex /("(r_[a-z_]*_time(_in_progress)?_ms|r_buffer_size|cost|r_partial_match_buffer_size)": )[^, \n]*/\1"REPLACED"/ /("r_engine_stats":) {[^}]*}/\1 REPLACED/ +--replace_regex /("(r_[a-z_]*_time(_in_progress)?_ms|r_buffer_size|cost|r_partial_match_buffer_size)": )[^, \n]*/\1"REPLACED"/ /("r_engine_stats":) \{(?:[^{}]|\{[^}]*\})*\}/\1 REPLACED/ diff --git a/mysql-test/main/rowid_filter_innodb,ahi.rdiff b/mysql-test/main/rowid_filter_innodb,ahi.rdiff index 9d0b7fc137c3c..0ae224004b0f9 100644 --- a/mysql-test/main/rowid_filter_innodb,ahi.rdiff +++ b/mysql-test/main/rowid_filter_innodb,ahi.rdiff @@ -9,21 +9,53 @@ DROP DATABASE IF EXISTS dbt3_s001; CREATE DATABASE dbt3_s001; use dbt3_s001; -@@ -2059,7 +2059,7 @@ +@@ -2061,7 +2061,11 @@ "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "r_engine_stats": { - "pages_accessed": 90 -+ "pages_accessed": 51 ++ "pages_accessed": 51, ++ "r_ahi_stats": { ++ "ahi_searches": 39, ++ "ahi_searches_btree": 3 ++ } }, "filtered": "REPLACED", "r_total_filtered": 2.43902439, -@@ -2227,7 +2227,7 @@ +@@ -2093,7 +2097,10 @@ + "r_table_time_ms": "REPLACED", + "r_other_time_ms": "REPLACED", + "r_engine_stats": { +- "pages_accessed": 4 ++ "pages_accessed": 4, ++ "r_ahi_stats": { ++ "ahi_searches_btree": 1 ++ } + }, + "filtered": "REPLACED", + "r_total_filtered": 66.66666667, +@@ -2229,7 +2236,11 @@ "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "r_engine_stats": { - "pages_accessed": 90 -+ "pages_accessed": 49 ++ "pages_accessed": 49, ++ "r_ahi_stats": { ++ "ahi_searches": 41, ++ "ahi_searches_btree": 1 ++ } }, "filtered": "REPLACED", "r_total_filtered": 2.43902439, +@@ -2261,7 +2272,10 @@ + "r_table_time_ms": "REPLACED", + "r_other_time_ms": "REPLACED", + "r_engine_stats": { +- "pages_accessed": 4 ++ "pages_accessed": 4, ++ "r_ahi_stats": { ++ "ahi_searches_btree": 1 ++ } + }, + "filtered": "REPLACED", + "r_total_filtered": 66.66666667, diff --git a/mysql-test/suite/innodb/include/check_ahi_status.inc b/mysql-test/suite/innodb/include/check_ahi_status.inc new file mode 100644 index 0000000000000..7fea1db7ce4d2 --- /dev/null +++ b/mysql-test/suite/innodb/include/check_ahi_status.inc @@ -0,0 +1,45 @@ +# Include file to execute a query with optional repetition and display +# values of r_ahi_stats on ANALYZE FORMAT=JSON +# +# Parameters: +# $query - The query to execute +# $repeat - Number of times to repeat the query before analyzing +# +# This include file will: +# 1. Execute the query $repeat times to warm up AHI (with logging disabled) +# 2. Execute ANALYZE FORMAT=JSON on the query and display the values + +--disable_query_log +--disable_result_log + +# Repeat the query to warm up AHI +let $i = $repeat; +while ($i > 0) +{ + eval $query; + dec $i; +} + +--enable_result_log +--enable_query_log + +# Execute ANALYZE FORMAT=JSON once and capture output +--echo ANALYZE FORMAT=JSON $query +let $out=`ANALYZE FORMAT=JSON $query`; + +# Parse JSON and extract AHI variables +--disable_query_log +evalp set @js='$out'; +set @ahi_searches = COALESCE(json_extract(@js,'$**.r_engine_stats.r_ahi_stats.ahi_searches'), 0); +set @ahi_searches_btree = COALESCE(json_extract(@js,'$**.r_engine_stats.r_ahi_stats.ahi_searches_btree'), 0); +set @ahi_rows_added = COALESCE(json_extract(@js,'$**.r_engine_stats.r_ahi_stats.ahi_rows_added'), 0); +set @ahi_pages_added = COALESCE(json_extract(@js,'$**.r_engine_stats.r_ahi_stats.ahi_pages_added'), 0); +set @r_rows = json_extract(@js,'$**.table.r_rows'); + +# Display AHI variables +select @ahi_searches as ahi_searches, + @ahi_searches_btree as ahi_searches_btree, + @ahi_rows_added as ahi_rows_added, + @ahi_pages_added as ahi_pages_added, + @r_rows as r_rows; +--enable_query_log diff --git a/mysql-test/suite/innodb/r/ahi_stats.result b/mysql-test/suite/innodb/r/ahi_stats.result new file mode 100644 index 0000000000000..8ebb415602cdb --- /dev/null +++ b/mysql-test/suite/innodb/r/ahi_stats.result @@ -0,0 +1,30 @@ +# +# MDEV 38305 : Expose adaptive hash index statistics in ANALYZE FORMAT=JSON +# +SET @start_global_value= @@global.innodb_adaptive_hash_index; +SET GLOBAL innodb_adaptive_hash_index= ON; +CREATE TABLE t1 ( +id INT PRIMARY KEY, +col1 INT, +col2 INT, +col3 INT, +INDEX idx_1 (col1), +INDEX idx_2 (col2), +INDEX idx_3 (col3) +) ENGINE=InnoDB; +INSERT INTO t1 SELECT seq, seq % 20, seq % 5, seq % 10 FROM seq_0_to_999; +ANALYZE FORMAT=JSON SELECT * FROM t1 FORCE INDEX(idx_1) WHERE col1 = 5 +ahi_searches ahi_searches_btree ahi_rows_added ahi_pages_added r_rows +0 [51] 0 0 [50] +ANALYZE FORMAT=JSON SELECT * FROM t1 FORCE INDEX(idx_2) WHERE col2 = 3 +ahi_searches ahi_searches_btree ahi_rows_added ahi_pages_added r_rows +[129] [72] [797] [2] [200] +ANALYZE FORMAT=JSON SELECT * FROM t1 FORCE INDEX(idx_3) WHERE col3 = 5 +ahi_searches ahi_searches_btree ahi_rows_added ahi_pages_added r_rows +[101] 0 0 0 [100] +SET GLOBAL innodb_adaptive_hash_index = OFF; +ANALYZE FORMAT=JSON SELECT * FROM t1 FORCE INDEX(idx_2) WHERE col2 = 2 +ahi_searches ahi_searches_btree ahi_rows_added ahi_pages_added r_rows +0 0 0 0 [200] +DROP TABLE t1; +SET GLOBAL innodb_adaptive_hash_index= @start_global_value; diff --git a/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result b/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result index 4fa9593444652..fe4af4ab37c22 100644 --- a/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result +++ b/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result @@ -188,9 +188,9 @@ index_page_reorg_successful index 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NU index_page_discards index 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of index pages discarded adaptive_hash_searches adaptive_hash_index 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of successful searches using Adaptive Hash Index adaptive_hash_searches_btree adaptive_hash_index 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of searches using B-tree on an index search -adaptive_hash_pages_added adaptive_hash_index 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of index pages on which the Adaptive Hash Index is built +adaptive_hash_pages_added adaptive_hash_index 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of index pages on which the Adaptive Hash Index is built adaptive_hash_pages_removed adaptive_hash_index 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of index pages whose corresponding Adaptive Hash Index entries were removed -adaptive_hash_rows_added adaptive_hash_index 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of Adaptive Hash Index rows added +adaptive_hash_rows_added adaptive_hash_index 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of Adaptive Hash Index rows added adaptive_hash_rows_removed adaptive_hash_index 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of Adaptive Hash Index rows removed adaptive_hash_rows_deleted_no_hash_entry adaptive_hash_index 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of rows deleted that did not have corresponding Adaptive Hash Index entries adaptive_hash_rows_updated adaptive_hash_index 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of Adaptive Hash Index rows updated diff --git a/mysql-test/suite/innodb/r/innodb_status_variables.result b/mysql-test/suite/innodb/r/innodb_status_variables.result index 7eb6f66a778cd..7f066d39a1191 100644 --- a/mysql-test/suite/innodb/r/innodb_status_variables.result +++ b/mysql-test/suite/innodb/r/innodb_status_variables.result @@ -5,6 +5,8 @@ AND variable_name NOT IN 'INNODB_MEM_ADAPTIVE_HASH', 'INNODB_BUFFERED_AIO_SUBMITTED','INNODB_BUFFER_POOL_PAGES_LATCHED'); variable_name +INNODB_ADAPTIVE_HASH_PAGES_ADDED +INNODB_ADAPTIVE_HASH_ROWS_ADDED INNODB_ASYNC_READS_PENDING INNODB_ASYNC_READS_TASKS_RUNNING INNODB_ASYNC_READS_TOTAL_COUNT diff --git a/mysql-test/suite/innodb/t/ahi_stats.test b/mysql-test/suite/innodb/t/ahi_stats.test new file mode 100644 index 0000000000000..c6173f4790154 --- /dev/null +++ b/mysql-test/suite/innodb/t/ahi_stats.test @@ -0,0 +1,78 @@ +--source include/have_innodb.inc +--source include/have_innodb_16k.inc +--source include/have_sequence.inc + +--echo # +--echo # MDEV 38305 : Expose adaptive hash index statistics in ANALYZE FORMAT=JSON +--echo # + +# Test Plan: +# When queries use secondary indexes, InnoDB must lookup clustered index records +# using the primary key reference obtained from the secondary index. These +# clustered index lookups accumulate and trigger AHI building when a threshold +# is reached. This test verifies that AHI statistics are correctly reported in +# ANALYZE FORMAT=JSON output across different scenarios: +# +# Test 1: Access 50 rows (col1=5, 50 matches) - insufficient to build AHI +# Test 2: Access 200 rows (col2=3, 200 matches) - combined with Test 1 (250 total), +# this triggers AHI construction on the clustered index +# Test 3: Access with heavy warmup (100 repetitions) - AHI fully utilized +# Test 4: AHI disabled - verify statistics are zero regardless of access patterns + +SET @start_global_value= @@global.innodb_adaptive_hash_index; +SET GLOBAL innodb_adaptive_hash_index= ON; + +CREATE TABLE t1 ( + id INT PRIMARY KEY, + col1 INT, + col2 INT, + col3 INT, + INDEX idx_1 (col1), + INDEX idx_2 (col2), + INDEX idx_3 (col3) +) ENGINE=InnoDB; + +INSERT INTO t1 SELECT seq, seq % 20, seq % 5, seq % 10 FROM seq_0_to_999; + +# Test 1: Insufficient accesses to build AHI +# Query accesses 50 rows (col1=5 matches 50 out of 1000 rows: 5,25,45,...,985). +# When using idx_1, InnoDB performs 50 clustered index lookups to retrieve the +# full rows. This is insufficient to trigger AHI construction, so AHI statistics +# should show minimal or no AHI activity. +let $query = SELECT * FROM t1 FORCE INDEX(idx_1) WHERE col1 = 5; +let $repeat = 0; +--source suite/innodb/include/check_ahi_status.inc + +# Test 2: Accumulated accesses trigger AHI construction +# Query accesses 200 rows (col2=3 matches 200 out of 1000 rows: 3,8,13,18,...,998). +# Combined with Test 1's 50 clustered index lookups, the accumulated total of 250 +# clustered index searches crosses the threshold to build AHI. This test verifies +# that AHI statistics reflect the construction and initial usage of the hash index. +let $query = SELECT * FROM t1 FORCE INDEX(idx_2) WHERE col2 = 3; +let $repeat = 0; +--source suite/innodb/include/check_ahi_status.inc + +# Test 3: Verify AHI statistics with heavy warmup (AHI fully utilized) +# Query accesses 100 rows (col3=5 matches 100 out of 1000 rows: 5,15,25,...,995). +# With repeat=200, this executes the query 200 times before the ANALYZE, resulting +# in 20,000 clustered index lookups. This heavy access pattern ensures the AHI is +# fully built and actively serving lookups, allowing verification that AHI hit +# statistics are properly reported when the hash index is effectively utilized. +let $query = SELECT * FROM t1 FORCE INDEX(idx_3) WHERE col3 = 5; +let $repeat = 200; +--source suite/innodb/include/check_ahi_status.inc + +# Test 4: Verify AHI statistics when AHI is disabled +# Query accesses 200 rows (col2=2 matches 200 out of 1000 rows: 2,7,12,...,997). +# With repeat=100, this would normally trigger heavy AHI usage (20,000 clustered +# index lookups). However, since innodb_adaptive_hash_index is turned OFF, the AHI +# is not used and all AHI statistics should be zero regardless of query repetition. +SET GLOBAL innodb_adaptive_hash_index = OFF; + +let $query = SELECT * FROM t1 FORCE INDEX(idx_2) WHERE col2 = 2; +let $repeat = 100; +--source suite/innodb/include/check_ahi_status.inc + +# Cleanup +DROP TABLE t1; +SET GLOBAL innodb_adaptive_hash_index= @start_global_value; diff --git a/sql/ha_handler_stats.h b/sql/ha_handler_stats.h index 808b4d401efbc..1ba401cfde828 100644 --- a/sql/ha_handler_stats.h +++ b/sql/ha_handler_stats.h @@ -41,6 +41,11 @@ class ha_handler_stats ulonglong undo_records_read; + ulonglong ahi_searches; /* Successful adaptive hash lookups */ + ulonglong ahi_searches_btree; /* B-tree searches (AHI miss) */ + ulonglong ahi_rows_added; /* Rows added to adaptive hash index */ + ulonglong ahi_pages_added; /* Pages added to adaptive hash index */ + /* Time spent in engine, in timer_tracker_frequency() units */ ulonglong engine_time; diff --git a/sql/sql_explain.cc b/sql/sql_explain.cc index 5332b32d70a51..77aab40092f65 100644 --- a/sql/sql_explain.cc +++ b/sql/sql_explain.cc @@ -1952,6 +1952,20 @@ static void trace_engine_stats(handler *file, Json_writer *writer) writer->add_member("pages_prefetch_read_count").add_ull(hs->pages_prefetched); if (hs->undo_records_read) writer->add_member("old_rows_read").add_ull(hs->undo_records_read); + if (unlikely(hs->ahi_searches | hs->ahi_searches_btree | + hs->ahi_rows_added | hs->ahi_pages_added)) + { + writer->add_member("r_ahi_stats").start_object(); + if (hs->ahi_searches) + writer->add_member("ahi_searches").add_ull(hs->ahi_searches); + if (hs->ahi_searches_btree) + writer->add_member("ahi_searches_btree").add_ull(hs->ahi_searches_btree); + if (hs->ahi_rows_added) + writer->add_member("ahi_rows_added").add_ull(hs->ahi_rows_added); + if (hs->ahi_pages_added) + writer->add_member("ahi_pages_added").add_ull(hs->ahi_pages_added); + writer->end_object(); + } writer->end_object(); } } diff --git a/storage/innobase/btr/btr0btr.cc b/storage/innobase/btr/btr0btr.cc index efe9a923a3079..9b07528796d73 100644 --- a/storage/innobase/btr/btr0btr.cc +++ b/storage/innobase/btr/btr0btr.cc @@ -1888,7 +1888,7 @@ btr_root_raise_and_insert( page_get_infimum_rec(root->page.frame)); } - btr_search_move_or_delete_hash_entries(new_block, root); + btr_search_move_or_delete_hash_entries(new_block, root, *mtr); } constexpr uint16_t max_trx_id = PAGE_HEADER + PAGE_MAX_TRX_ID; @@ -3064,7 +3064,7 @@ btr_page_split_and_insert( } btr_search_move_or_delete_hash_entries( - new_block, block); + new_block, block, *mtr); /* Delete the records from the source page. */ @@ -3112,7 +3112,7 @@ btr_page_split_and_insert( } btr_search_move_or_delete_hash_entries( - new_block, block); + new_block, block, *mtr); /* Delete the records from the source page. */ @@ -3460,7 +3460,7 @@ btr_lift_page_up( lock_prdt_rec_move(father_block, block->page.id()); } else { btr_search_move_or_delete_hash_entries( - father_block, block); + father_block, block, *mtr); } } diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc index ac34ab61e5497..97ad0a25bf83b 100644 --- a/storage/innobase/btr/btr0cur.cc +++ b/storage/innobase/btr/btr0cur.cc @@ -88,18 +88,22 @@ throughput clearly from about 100000. */ #ifdef BTR_CUR_HASH_ADAPT /** Number of searches down the B-tree in btr_cur_t::search_leaf(). */ -ib_counter_t btr_cur_n_non_sea; +Atomic_counter btr_cur_n_non_sea; /** Old value of btr_cur_n_non_sea. Copied by srv_refresh_innodb_monitor_stats(). Referenced by srv_printf_innodb_monitor(). */ ulint btr_cur_n_non_sea_old; /** Number of successful adaptive hash index lookups in btr_cur_t::search_leaf(). */ -ib_counter_t btr_cur_n_sea; +Atomic_counter btr_cur_n_sea; /** Old value of btr_cur_n_sea. Copied by srv_refresh_innodb_monitor_stats(). Referenced by srv_printf_innodb_monitor(). */ ulint btr_cur_n_sea_old; +/** Number of rows added to the adaptive hash index. */ +Atomic_counter btr_ahi_n_rows_added; +/** Number of pages added to the adaptive hash index. */ +Atomic_counter btr_ahi_n_pages_added; #endif /* BTR_CUR_HASH_ADAPT */ #ifdef UNIV_DEBUG @@ -1078,6 +1082,24 @@ static int btr_latch_prev(rw_lock_type_t rw_latch, return ret; } +#ifdef BTR_CUR_HASH_ADAPT +/** Increment successful adaptive hash index lookups */ +static inline void btr_ahi_inc_searches(const mtr_t &mtr) noexcept +{ + mtr.trx->n_sea++; + if (ha_handler_stats *stats= mtr.trx->active_handler_stats) + stats->ahi_searches++; +} + +/** Increment adaptive hash index misses (B-tree fallback) */ +static inline void btr_ahi_inc_searches_btree(const mtr_t &mtr) noexcept +{ + mtr.trx->n_non_sea++; + if (ha_handler_stats *stats= mtr.trx->active_handler_stats) + stats->ahi_searches_btree++; +} +#endif /* BTR_CUR_HASH_ADAPT */ + dberr_t btr_cur_t::search_leaf(const dtuple_t *tuple, page_cur_mode_t mode, btr_latch_mode latch_mode, mtr_t *mtr) { @@ -1146,12 +1168,12 @@ dberr_t btr_cur_t::search_leaf(const dtuple_t *tuple, page_cur_mode_t mode, ut_ad(up_match != uint16_t(~0U) || mode != PAGE_CUR_LE); ut_ad(low_match != uint16_t(~0U) || mode != PAGE_CUR_LE); DBUG_EXECUTE_IF("btr_cur_n_sea_delay", my_sleep(200000);); - ++btr_cur_n_sea; + btr_ahi_inc_searches(*mtr); return DB_SUCCESS; } else - ++btr_cur_n_non_sea; + btr_ahi_inc_searches_btree(*mtr); # endif #endif @@ -1430,7 +1452,7 @@ dberr_t btr_cur_t::search_leaf(const dtuple_t *tuple, page_cur_mode_t mode, ut_ad(!index()->table->is_temporary()); if (!rec_is_metadata(page_cur.rec, *index()) && index()->search_info.hash_analysis_useful()) - search_info_update(); + search_info_update(*mtr); } #endif /* BTR_CUR_HASH_ADAPT */ @@ -1670,7 +1692,7 @@ dberr_t btr_cur_t::pessimistic_search_leaf(const dtuple_t *tuple, else if (index()->table->is_temporary()); else if (!rec_is_metadata(page_cur.rec, *index()) && index()->search_info.hash_analysis_useful()) - search_info_update(); + search_info_update(*mtr); #endif /* BTR_CUR_HASH_ADAPT */ err= DB_SUCCESS; } @@ -2523,7 +2545,7 @@ btr_cur_optimistic_insert( ut_ad(index->is_instant()); ut_ad(flags == BTR_NO_LOCKING_FLAG); } else if (!index->table->is_temporary()) { - btr_search_update_hash_on_insert(cursor, reorg); + btr_search_update_hash_on_insert(cursor, reorg, *mtr); } #endif /* BTR_CUR_HASH_ADAPT */ @@ -2696,7 +2718,7 @@ btr_cur_pessimistic_insert( ut_ad(flags & BTR_NO_LOCKING_FLAG); ut_ad(!(flags & BTR_CREATE_FLAG)); } else if (!index->table->is_temporary()) { - btr_search_update_hash_on_insert(cursor, false); + btr_search_update_hash_on_insert(cursor, false, *mtr); } #endif /* BTR_CUR_HASH_ADAPT */ if (inherit && !(flags & BTR_NO_LOCKING_FLAG)) { diff --git a/storage/innobase/btr/btr0sea.cc b/storage/innobase/btr/btr0sea.cc index e410cfe1eba41..44f74f05f0781 100644 --- a/storage/innobase/btr/btr0sea.cc +++ b/storage/innobase/btr/btr0sea.cc @@ -82,6 +82,21 @@ inline ahi_node **btr_sea::hash_chain::search(UnaryPred u) noexcept return prev; } +static void btr_ahi_inc_rows_added(const mtr_t &mtr, ulonglong count= 1) + noexcept +{ + mtr.trx->n_ahi_rows_added+= count; + if (ha_handler_stats *stats= mtr.trx->active_handler_stats) + stats->ahi_rows_added+= count; +} + +static void btr_ahi_inc_pages_added(const mtr_t &mtr) noexcept +{ + mtr.trx->n_ahi_pages_added++; + if (ha_handler_stats *stats= mtr.trx->active_handler_stats) + stats->ahi_pages_added++; +} + inline void btr_sea::partition::init() noexcept { latch.SRW_LOCK_INIT(btr_search_latch_key); @@ -580,10 +595,12 @@ references. This function lazily fixes these imperfections in the hash index. @param cursor B-tree cursor @param block cursor block -@param left_bytes_fields AHI paramaters */ +@param left_bytes_fields AHI paramaters +@param mtr mini-transaction (to update trx AHI statistics)*/ static void btr_search_update_hash_ref(const btr_cur_t &cursor, buf_block_t *block, - uint32_t left_bytes_fields) noexcept + uint32_t left_bytes_fields, + const mtr_t &mtr) noexcept { ut_ad(block == cursor.page_cur.block); #ifdef UNIV_SEARCH_PERF_STAT @@ -632,7 +649,7 @@ static void btr_search_update_hash_ref(const btr_cur_t &cursor, } part.insert(fold, rec, block); - MONITOR_INC(MONITOR_ADAPTIVE_HASH_ROW_ADDED); + btr_ahi_inc_rows_added(mtr); } else { @@ -652,9 +669,11 @@ static void btr_search_update_hash_ref(const btr_cur_t &cursor, /** Updates the search info of an index about hash successes. @param cursor freshly positioned cursor +@param mtr mini-transaction (to update trx AHI statistics) @return AHI parameters @retval 0 if the adaptive hash index should not be rebuilt */ -static uint32_t btr_search_info_update_hash(const btr_cur_t &cursor) noexcept +static uint32_t btr_search_info_update_hash(const btr_cur_t &cursor, + const mtr_t &mtr) noexcept { ut_ad(cursor.flag == BTR_CUR_HASH_FAIL || cursor.flag == BTR_CUR_HASH_ABORT || @@ -819,7 +838,7 @@ static uint32_t btr_search_info_update_hash(const btr_cur_t &cursor) noexcept btr_search_drop_page_hash_index(block, nullptr); } else if (cursor.flag == BTR_CUR_HASH_FAIL) - btr_search_update_hash_ref(cursor, block, left_bytes_fields); + btr_search_update_hash_ref(cursor, block, left_bytes_fields, mtr); ut_ad(!ret || ((ret & mask) == (fixed & mask))); DBUG_EXECUTE_IF("index_ahi_option_debug_check", @@ -1709,11 +1728,13 @@ has a hash index with different parameters, the old hash index is removed. @param index B-tree index @param block latched B-tree leaf page @param part the adaptive search partition -@param left_bytes_fields hash parameters */ +@param left_bytes_fields hash parameters +@param mtr mini-transaction (to update trx AHI statistics)*/ static void btr_search_build_page_hash_index(dict_index_t *index, buf_block_t *block, btr_sea::partition &part, - const uint32_t left_bytes_fields) + const uint32_t left_bytes_fields, + const mtr_t &mtr) noexcept { ut_ad(!index->table->is_temporary()); @@ -1869,7 +1890,7 @@ static void btr_search_build_page_hash_index(dict_index_t *index, part.latch.wr_rd_downgrade(SRW_LOCK_CALL); # endif - MONITOR_INC_VALUE(MONITOR_ADAPTIVE_HASH_ROW_ADDED, n_cached); + btr_ahi_inc_rows_added(mtr, n_cached); for (size_t i= 0; i < n_cached; i++) { @@ -1904,21 +1925,22 @@ static void btr_search_build_page_hash_index(dict_index_t *index, goto next_redundant; } - MONITOR_INC(MONITOR_ADAPTIVE_HASH_PAGE_ADDED); + btr_ahi_inc_pages_added(mtr); assert_block_ahi_valid(block); part.latch.rd_unlock(); } -void btr_cur_t::search_info_update() const noexcept +void btr_cur_t::search_info_update(const mtr_t &mtr) const noexcept { - if (uint32_t left_bytes_fields= btr_search_info_update_hash(*this)) + if (uint32_t left_bytes_fields= btr_search_info_update_hash(*this, mtr)) btr_search_build_page_hash_index(index(), page_cur.block, btr_search.get_part(*index()), - left_bytes_fields); + left_bytes_fields, mtr); } void btr_search_move_or_delete_hash_entries(buf_block_t *new_block, - buf_block_t *block) noexcept + buf_block_t *block, + const mtr_t &mtr) noexcept { ut_ad(block->page.lock.have_x()); ut_ad(new_block->page.lock.have_x()); @@ -1961,7 +1983,7 @@ void btr_search_move_or_delete_hash_entries(buf_block_t *new_block, ut_ad(left_bytes_fields & ~buf_block_t::LEFT_SIDE); part.latch.rd_unlock(); btr_search_build_page_hash_index(index, new_block, part, - left_bytes_fields); + left_bytes_fields, mtr); return; } @@ -2041,7 +2063,8 @@ void btr_search_update_hash_on_delete(btr_cur_t *cursor) noexcept } } -void btr_search_update_hash_on_insert(btr_cur_t *cursor, bool reorg) noexcept +void btr_search_update_hash_on_insert(btr_cur_t *cursor, bool reorg, + const mtr_t &mtr) noexcept { ut_ad(!cursor->index()->table->is_temporary()); ut_ad(page_is_leaf(btr_cur_get_page(cursor))); @@ -2160,7 +2183,7 @@ void btr_search_update_hash_on_insert(btr_cur_t *cursor, bool reorg) noexcept goto unlock_exit; } part.insert(ins_fold, ins_rec, block); - MONITOR_INC(MONITOR_ADAPTIVE_HASH_ROW_ADDED); + btr_ahi_inc_rows_added(mtr); } } else if (fold != ins_fold) @@ -2175,7 +2198,7 @@ void btr_search_update_hash_on_insert(btr_cur_t *cursor, bool reorg) noexcept if (left_bytes_fields & buf_block_t::LEFT_SIDE) fold= ins_fold, rec= ins_rec; part.insert(fold, rec, block); - MONITOR_INC(MONITOR_ADAPTIVE_HASH_ROW_ADDED); + btr_ahi_inc_rows_added(mtr); } if (next_is_supremum) @@ -2190,7 +2213,7 @@ void btr_search_update_hash_on_insert(btr_cur_t *cursor, bool reorg) noexcept goto rollback; } part.insert(ins_fold, ins_rec, block); - MONITOR_INC(MONITOR_ADAPTIVE_HASH_ROW_ADDED); + btr_ahi_inc_rows_added(mtr); } } else if (ins_fold != next_fold) @@ -2205,7 +2228,7 @@ void btr_search_update_hash_on_insert(btr_cur_t *cursor, bool reorg) noexcept if (!(left_bytes_fields & ~buf_block_t::LEFT_SIDE)) next_fold= ins_fold, next_rec= ins_rec; part.insert(next_fold, next_rec, block); - MONITOR_INC(MONITOR_ADAPTIVE_HASH_ROW_ADDED); + btr_ahi_inc_rows_added(mtr); } ut_ad(!locked || index == block->index); diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 5e6f8e44e7e29..5ddcf8452132e 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -936,6 +936,8 @@ static SHOW_VAR innodb_status_variables[]= { {"adaptive_hash_hash_searches", &export_vars.innodb_ahi_hit, SHOW_SIZE_T}, {"adaptive_hash_non_hash_searches", &export_vars.innodb_ahi_miss, SHOW_SIZE_T}, + {"adaptive_hash_pages_added", &export_vars.innodb_ahi_pages_added, SHOW_SIZE_T}, + {"adaptive_hash_rows_added", &export_vars.innodb_ahi_rows_added, SHOW_SIZE_T}, #endif {"async_reads_pending", &export_vars.async_read_stats.pending_ops, SHOW_SIZE_T}, diff --git a/storage/innobase/include/btr0cur.h b/storage/innobase/include/btr0cur.h index 53f88cc8ca1f5..23da3b88174a9 100644 --- a/storage/innobase/include/btr0cur.h +++ b/storage/innobase/include/btr0cur.h @@ -752,7 +752,9 @@ struct btr_cur_t { mtr_t &mtr); #ifdef BTR_CUR_HASH_ADAPT - void search_info_update() const noexcept; + /** Update adaptive hash index based on search pattern. + @param mtr mini-transaction (to update trx AHI statistics) */ + void search_info_update(const mtr_t &mtr) const noexcept; /** Check if a guessed position for a tree cursor is correct. @param tuple search key @@ -816,18 +818,22 @@ inherited external field. */ #ifdef BTR_CUR_HASH_ADAPT /** Number of searches down the B-tree in btr_cur_t::search_leaf(). */ -extern ib_counter_t btr_cur_n_non_sea; +extern Atomic_counter btr_cur_n_non_sea; /** Old value of btr_cur_n_non_sea. Copied by srv_refresh_innodb_monitor_stats(). Referenced by srv_printf_innodb_monitor(). */ extern ulint btr_cur_n_non_sea_old; /** Number of successful adaptive hash index lookups in btr_cur_t::search_leaf(). */ -extern ib_counter_t btr_cur_n_sea; +extern Atomic_counter btr_cur_n_sea; /** Old value of btr_cur_n_sea. Copied by srv_refresh_innodb_monitor_stats(). Referenced by srv_printf_innodb_monitor(). */ extern ulint btr_cur_n_sea_old; +/** Number of rows added to the adaptive hash index. */ +extern Atomic_counter btr_ahi_n_rows_added; +/** Number of pages added to the adaptive hash index. */ +extern Atomic_counter btr_ahi_n_pages_added; #endif /* BTR_CUR_HASH_ADAPT */ #ifdef UNIV_DEBUG diff --git a/storage/innobase/include/btr0sea.h b/storage/innobase/include/btr0sea.h index d42a3b8e9efcc..879ceb1a01599 100644 --- a/storage/innobase/include/btr0sea.h +++ b/storage/innobase/include/btr0sea.h @@ -64,9 +64,11 @@ If new_block is already hashed, then any hash index for block is dropped. If new_block is not hashed, and block is hashed, then a new hash index is built to new_block with the same parameters as block. @param new_block destination page -@param block source page (subject to deletion later) */ +@param block source page (subject to deletion later) +@param mtr mini-transaction (to update trx AHI statistics) */ void btr_search_move_or_delete_hash_entries(buf_block_t *new_block, - buf_block_t *block) noexcept; + buf_block_t *block, + const mtr_t &mtr) noexcept; /** Drop any adaptive hash index entries that point to an index page. @param block latched block containing index page, or a buffer-unfixed @@ -84,8 +86,10 @@ void btr_search_drop_page_hash_when_freed(mtr_t *mtr, const page_id_t page_id) /** Update the page hash index after a single record is inserted on a page. @param cursor cursor which was positioned before the inserted record -@param reorg whether the page was reorganized */ -void btr_search_update_hash_on_insert(btr_cur_t *cursor, bool reorg) noexcept; +@param reorg whether the page was reorganized +@param mtr mini-transaction (to update trx AHI statistics) */ +void btr_search_update_hash_on_insert(btr_cur_t *cursor, bool reorg, + const mtr_t &mtr) noexcept; /** Updates the page hash index before a single record is deleted from a page. @param cursor cursor positioned on the to-be-deleted record */ @@ -432,8 +436,8 @@ extern ulint btr_search_n_hash_fail; # define btr_search_sys_create() # define btr_search_sys_free() # define btr_search_drop_page_hash_index(block, not_garbage) -# define btr_search_move_or_delete_hash_entries(new_block, block) -# define btr_search_update_hash_on_insert(cursor, ahi_latch) +# define btr_search_move_or_delete_hash_entries(new_block, block, mtr) +# define btr_search_update_hash_on_insert(cursor, ahi_latch, mtr) # define btr_search_update_hash_on_delete(cursor) # ifdef UNIV_DEBUG # define btr_search_check_marked_free_index(block) diff --git a/storage/innobase/include/srv0mon.h b/storage/innobase/include/srv0mon.h index 808449ef16599..27def437d90b7 100644 --- a/storage/innobase/include/srv0mon.h +++ b/storage/innobase/include/srv0mon.h @@ -325,9 +325,9 @@ enum monitor_id_t { MONITOR_MODULE_ADAPTIVE_HASH, MONITOR_OVLD_ADAPTIVE_HASH_SEARCH, MONITOR_OVLD_ADAPTIVE_HASH_SEARCH_BTREE, - MONITOR_ADAPTIVE_HASH_PAGE_ADDED, + MONITOR_OVLD_ADAPTIVE_HASH_PAGE_ADDED, MONITOR_ADAPTIVE_HASH_PAGE_REMOVED, - MONITOR_ADAPTIVE_HASH_ROW_ADDED, + MONITOR_OVLD_ADAPTIVE_HASH_ROW_ADDED, MONITOR_ADAPTIVE_HASH_ROW_REMOVED, MONITOR_ADAPTIVE_HASH_ROW_REMOVE_NOT_FOUND, MONITOR_ADAPTIVE_HASH_ROW_UPDATED, diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h index 97cd183ed145d..7e4737bc77d0f 100644 --- a/storage/innobase/include/srv0srv.h +++ b/storage/innobase/include/srv0srv.h @@ -570,6 +570,8 @@ struct export_var_t{ #ifdef BTR_CUR_HASH_ADAPT ulint innodb_ahi_hit; ulint innodb_ahi_miss; + ulint innodb_ahi_rows_added; + ulint innodb_ahi_pages_added; #endif /* BTR_CUR_HASH_ADAPT */ innodb_async_io_stats_t async_read_stats; innodb_async_io_stats_t async_write_stats; diff --git a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h index 9a9bd152bd0ed..4bcf2908a08ce 100644 --- a/storage/innobase/include/trx0trx.h +++ b/storage/innobase/include/trx0trx.h @@ -854,6 +854,16 @@ struct trx_t : ilist_node<> ha_handler_stats *active_handler_stats; /** number of pages accessed in the buffer pool */ size_t pages_accessed; +#ifdef BTR_CUR_HASH_ADAPT + /** number of successful adaptive hash index lookups */ + size_t n_sea; + /** number of B-tree searches without adaptive hash index */ + size_t n_non_sea; + /** number of rows added to adaptive hash index */ + size_t n_ahi_rows_added; + /** number of pages added to adaptive hash index */ + size_t n_ahi_pages_added; +#endif const char* mysql_log_file_name; /*!< if MySQL binlog is used, this field diff --git a/storage/innobase/page/page0page.cc b/storage/innobase/page/page0page.cc index b6d7922608017..1f08eb3318cda 100644 --- a/storage/innobase/page/page0page.cc +++ b/storage/innobase/page/page0page.cc @@ -652,7 +652,7 @@ page_copy_rec_list_end( mem_heap_free(heap); } - btr_search_move_or_delete_hash_entries(new_block, block); + btr_search_move_or_delete_hash_entries(new_block, block, *mtr); return(ret); } @@ -834,7 +834,7 @@ page_copy_rec_list_start( mem_heap_free(heap); } - btr_search_move_or_delete_hash_entries(new_block, block); + btr_search_move_or_delete_hash_entries(new_block, block, *mtr); *err = DB_SUCCESS; return(ret); diff --git a/storage/innobase/srv/srv0mon.cc b/storage/innobase/srv/srv0mon.cc index ebdf9f31c01f6..09605650699ae 100644 --- a/storage/innobase/srv/srv0mon.cc +++ b/storage/innobase/srv/srv0mon.cc @@ -873,8 +873,9 @@ static monitor_info_t innodb_counter_info[] = {"adaptive_hash_pages_added", "adaptive_hash_index", "Number of index pages on which the Adaptive Hash Index is built", - MONITOR_NONE, - MONITOR_DEFAULT_START, MONITOR_ADAPTIVE_HASH_PAGE_ADDED}, + static_cast( + MONITOR_EXISTING), + MONITOR_DEFAULT_START, MONITOR_OVLD_ADAPTIVE_HASH_PAGE_ADDED}, {"adaptive_hash_pages_removed", "adaptive_hash_index", "Number of index pages whose corresponding Adaptive Hash Index" @@ -884,8 +885,9 @@ static monitor_info_t innodb_counter_info[] = {"adaptive_hash_rows_added", "adaptive_hash_index", "Number of Adaptive Hash Index rows added", - MONITOR_NONE, - MONITOR_DEFAULT_START, MONITOR_ADAPTIVE_HASH_ROW_ADDED}, + static_cast( + MONITOR_EXISTING), + MONITOR_DEFAULT_START, MONITOR_OVLD_ADAPTIVE_HASH_ROW_ADDED}, {"adaptive_hash_rows_removed", "adaptive_hash_index", "Number of Adaptive Hash Index rows removed", @@ -1526,6 +1528,14 @@ srv_mon_process_existing_counter( case MONITOR_OVLD_ADAPTIVE_HASH_SEARCH_BTREE: value = btr_cur_n_non_sea; break; + + case MONITOR_OVLD_ADAPTIVE_HASH_ROW_ADDED: + value = btr_ahi_n_rows_added; + break; + + case MONITOR_OVLD_ADAPTIVE_HASH_PAGE_ADDED: + value = btr_ahi_n_pages_added; + break; #endif /* BTR_CUR_HASH_ADAPT */ case MONITOR_OVLD_PAGE_COMPRESS_SAVED: diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc index 434746aad8fae..8f5835e3e3948 100644 --- a/storage/innobase/srv/srv0srv.cc +++ b/storage/innobase/srv/srv0srv.cc @@ -830,6 +830,8 @@ srv_export_innodb_status(void) #ifdef BTR_CUR_HASH_ADAPT export_vars.innodb_ahi_hit = btr_cur_n_sea; export_vars.innodb_ahi_miss = btr_cur_n_non_sea; + export_vars.innodb_ahi_rows_added = btr_ahi_n_rows_added; + export_vars.innodb_ahi_pages_added = btr_ahi_n_pages_added; ulint mem_adaptive_hash = 0; for (ulong i = 0; i < btr_search.n_parts; i++) { diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc index 551819aef4cf0..3cb45a472c348 100644 --- a/storage/innobase/trx/trx0trx.cc +++ b/storage/innobase/trx/trx0trx.cc @@ -34,6 +34,7 @@ Created 3/26/1996 Heikki Tuuri #include +#include "btr0cur.h" #include "btr0sea.h" #include "lock0lock.h" #include "log0log.h" @@ -376,11 +377,13 @@ void trx_t::free() noexcept autoinc_locks.make_undefined(); ut_ad(!active_handler_stats); - if (size_t n_page_gets= pages_accessed) - { - pages_accessed= 0; - buf_pool.stat.n_page_gets+= n_page_gets; - } + buf_pool.stat.n_page_gets+= std::exchange(pages_accessed, 0); +#ifdef BTR_CUR_HASH_ADAPT + btr_cur_n_sea+= std::exchange(n_sea, 0); + btr_cur_n_non_sea+= std::exchange(n_non_sea, 0); + btr_ahi_n_rows_added+= std::exchange(n_ahi_rows_added, 0); + btr_ahi_n_pages_added+= std::exchange(n_ahi_pages_added, 0); +#endif ut_ad(!n_mysql_tables_in_use); ut_ad(!mysql_log_file_name); @@ -1539,11 +1542,13 @@ bool trx_t::commit_cleanup() noexcept for (auto &t : mod_tables) delete t.second.bulk_store; - if (size_t n_page_gets= pages_accessed) - { - pages_accessed= 0; - buf_pool.stat.n_page_gets+= n_page_gets; - } + buf_pool.stat.n_page_gets+= std::exchange(pages_accessed, 0); +#ifdef BTR_CUR_HASH_ADAPT + btr_cur_n_sea+= std::exchange(n_sea, 0); + btr_cur_n_non_sea+= std::exchange(n_non_sea, 0); + btr_ahi_n_rows_added+= std::exchange(n_ahi_rows_added, 0); + btr_ahi_n_pages_added+= std::exchange(n_ahi_pages_added, 0); +#endif mutex.wr_lock(); state= TRX_STATE_NOT_STARTED; *detailed_error= '\0'; diff --git a/storage/rocksdb/mysql-test/rocksdb/r/innodb_i_s_tables_disabled.result b/storage/rocksdb/mysql-test/rocksdb/r/innodb_i_s_tables_disabled.result index 4b8e3802c562a..a9e3b23909b6f 100644 --- a/storage/rocksdb/mysql-test/rocksdb/r/innodb_i_s_tables_disabled.result +++ b/storage/rocksdb/mysql-test/rocksdb/r/innodb_i_s_tables_disabled.result @@ -170,9 +170,9 @@ index_page_reorg_successful index 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NU index_page_discards index 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of index pages discarded adaptive_hash_searches adaptive_hash_index 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of successful searches using Adaptive Hash Index adaptive_hash_searches_btree adaptive_hash_index 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of searches using B-tree on an index search -adaptive_hash_pages_added adaptive_hash_index 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of index pages on which the Adaptive Hash Index is built +adaptive_hash_pages_added adaptive_hash_index 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of index pages on which the Adaptive Hash Index is built adaptive_hash_pages_removed adaptive_hash_index 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of index pages whose corresponding Adaptive Hash Index entries were removed -adaptive_hash_rows_added adaptive_hash_index 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of Adaptive Hash Index rows added +adaptive_hash_rows_added adaptive_hash_index 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of Adaptive Hash Index rows added adaptive_hash_rows_removed adaptive_hash_index 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of Adaptive Hash Index rows removed adaptive_hash_rows_deleted_no_hash_entry adaptive_hash_index 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of rows deleted that did not have corresponding Adaptive Hash Index entries adaptive_hash_rows_updated adaptive_hash_index 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of Adaptive Hash Index rows updated