From 4e1bf2bb2368b0ebb98e20563f4834c1061ed498 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 16 May 2022 13:41:53 +0300 Subject: [PATCH] MDEV-28537 Unused or useless InnoDB counters num_index_pages_written, num_non_index_pages_written The counters were added in commit 5e55d1ced52c52fb2f0508e1346059901a85960f and any code to update them was inadvertently removed in commit 2e814d4702d71a04388386a9f591d14a35980bfe when applying InnoDB changes from MySQL 5.7. Let us remove these counters that never reported anything useful. If such statistics are really needed in a special case, they can be obtained by instrumenting the code by some means, such as eBPF or a source code patch. --- .../r/innodb_skip_innodb_is_tables.result | 2 -- mysql-test/suite/innodb/r/monitor.result | 2 -- storage/innobase/handler/ha_innodb.cc | 4 ---- storage/innobase/include/srv0mon.h | 4 +--- storage/innobase/include/srv0srv.h | 8 ------- storage/innobase/srv/srv0mon.cc | 24 +------------------ storage/innobase/srv/srv0srv.cc | 2 -- .../r/innodb_i_s_tables_disabled.result | 2 -- 8 files changed, 2 insertions(+), 46 deletions(-) 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 015bfe9dcef..fe851bc3b25 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 @@ -71,8 +71,6 @@ buffer_pool_bytes_dirty buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL buffer_pool_pages_free buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled value Buffer pages currently free (innodb_buffer_pool_pages_free) buffer_pages_created buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of pages created (innodb_pages_created) buffer_pages_written buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of pages written (innodb_pages_written) -buffer_index_pages_written buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of index pages written (innodb_index_pages_written) -buffer_non_index_pages_written buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of non index pages written (innodb_non_index_pages_written) buffer_pages_read buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of pages read (innodb_pages_read) buffer_pages0_read buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of page 0 read (innodb_pages0_read) buffer_index_sec_rec_cluster_reads buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of secondary record reads triggered cluster read diff --git a/mysql-test/suite/innodb/r/monitor.result b/mysql-test/suite/innodb/r/monitor.result index a40bfdac0d0..b65bba276f0 100644 --- a/mysql-test/suite/innodb/r/monitor.result +++ b/mysql-test/suite/innodb/r/monitor.result @@ -36,8 +36,6 @@ buffer_pool_bytes_dirty disabled buffer_pool_pages_free disabled buffer_pages_created disabled buffer_pages_written disabled -buffer_index_pages_written disabled -buffer_non_index_pages_written disabled buffer_pages_read disabled buffer_pages0_read disabled buffer_index_sec_rec_cluster_reads disabled diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 40754a131ee..8c610b0fc3d 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -1142,10 +1142,6 @@ static SHOW_VAR innodb_status_variables[]= { /* Status variables for page compression */ {"page_compression_saved", (char*) &export_vars.innodb_page_compression_saved, SHOW_LONGLONG}, - {"num_index_pages_written", - (char*) &export_vars.innodb_index_pages_written, SHOW_LONGLONG}, - {"num_non_index_pages_written", - (char*) &export_vars.innodb_non_index_pages_written, SHOW_LONGLONG}, {"num_pages_page_compressed", (char*) &export_vars.innodb_pages_page_compressed, SHOW_LONGLONG}, {"num_page_compressed_trim_op", diff --git a/storage/innobase/include/srv0mon.h b/storage/innobase/include/srv0mon.h index 17e72b6b218..1a825c419dd 100644 --- a/storage/innobase/include/srv0mon.h +++ b/storage/innobase/include/srv0mon.h @@ -2,7 +2,7 @@ Copyright (c) 2010, 2015, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2012, Facebook Inc. -Copyright (c) 2013, 2020, MariaDB Corporation. +Copyright (c) 2013, 2022, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the @@ -174,8 +174,6 @@ enum monitor_id_t { MONITOR_OVLD_BUF_POOL_PAGES_FREE, MONITOR_OVLD_PAGE_CREATED, MONITOR_OVLD_PAGES_WRITTEN, - MONITOR_OVLD_INDEX_PAGES_WRITTEN, - MONITOR_OVLD_NON_INDEX_PAGES_WRITTEN, MONITOR_OVLD_PAGES_READ, MONITOR_OVLD_PAGES0_READ, MONITOR_OVLD_INDEX_SEC_REC_CLUSTER_READS, diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h index a7bed269fa4..8cf568a0105 100644 --- a/storage/innobase/include/srv0srv.h +++ b/storage/innobase/include/srv0srv.h @@ -109,10 +109,6 @@ struct srv_stats_t /** Number of bytes saved by page compression */ ulint_ctr_64_t page_compression_saved; - /* Number of index pages written */ - ulint_ctr_64_t index_pages_written; - /* Number of non index pages written */ - ulint_ctr_64_t non_index_pages_written; /* Number of pages compressed with page compression */ ulint_ctr_64_t pages_page_compressed; /* Number of TRIM operations induced by page compression */ @@ -1030,10 +1026,6 @@ struct export_var_t{ int64_t innodb_page_compression_saved;/*!< Number of bytes saved by page compression */ - int64_t innodb_index_pages_written; /*!< Number of index pages - written */ - int64_t innodb_non_index_pages_written; /*!< Number of non index pages - written */ int64_t innodb_pages_page_compressed;/*!< Number of pages compressed by page compression */ int64_t innodb_page_compressed_trim_op;/*!< Number of TRIM operations diff --git a/storage/innobase/srv/srv0mon.cc b/storage/innobase/srv/srv0mon.cc index 0404335574a..39f495c4ced 100644 --- a/storage/innobase/srv/srv0mon.cc +++ b/storage/innobase/srv/srv0mon.cc @@ -2,7 +2,7 @@ Copyright (c) 2010, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2012, Facebook Inc. -Copyright (c) 2013, 2018, MariaDB Corporation. +Copyright (c) 2013, 2022, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -280,18 +280,6 @@ static monitor_info_t innodb_counter_info[] = MONITOR_EXISTING | MONITOR_DEFAULT_ON), MONITOR_DEFAULT_START, MONITOR_OVLD_PAGES_WRITTEN}, - {"buffer_index_pages_written", "buffer", - "Number of index pages written (innodb_index_pages_written)", - static_cast( - MONITOR_EXISTING | MONITOR_DEFAULT_ON), - MONITOR_DEFAULT_START, MONITOR_OVLD_INDEX_PAGES_WRITTEN}, - - {"buffer_non_index_pages_written", "buffer", - "Number of non index pages written (innodb_non_index_pages_written)", - static_cast( - MONITOR_EXISTING | MONITOR_DEFAULT_ON), - MONITOR_DEFAULT_START, MONITOR_OVLD_NON_INDEX_PAGES_WRITTEN}, - {"buffer_pages_read", "buffer", "Number of pages read (innodb_pages_read)", static_cast( @@ -1732,16 +1720,6 @@ srv_mon_process_existing_counter( value = stat.n_pages_written; break; - /* innodb_index_pages_written, the number of index pages written */ - case MONITOR_OVLD_INDEX_PAGES_WRITTEN: - value = srv_stats.index_pages_written; - break; - - /* innodb_non_index_pages_written, the number of non index pages written */ - case MONITOR_OVLD_NON_INDEX_PAGES_WRITTEN: - value = srv_stats.non_index_pages_written; - break; - /* innodb_pages_read */ case MONITOR_OVLD_PAGES_READ: buf_get_total_stat(&stat); diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc index 2bc5500ef91..811892b3cab 100644 --- a/storage/innobase/srv/srv0srv.cc +++ b/storage/innobase/srv/srv0srv.cc @@ -1575,8 +1575,6 @@ srv_export_innodb_status(void) export_vars.innodb_available_undo_logs = srv_available_undo_logs; export_vars.innodb_page_compression_saved = srv_stats.page_compression_saved; - export_vars.innodb_index_pages_written = srv_stats.index_pages_written; - export_vars.innodb_non_index_pages_written = srv_stats.non_index_pages_written; export_vars.innodb_pages_page_compressed = srv_stats.pages_page_compressed; export_vars.innodb_page_compressed_trim_op = srv_stats.page_compressed_trim_op; export_vars.innodb_pages_page_decompressed = srv_stats.pages_page_decompressed; 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 61f005c1758..a7679e7cc3e 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 @@ -53,8 +53,6 @@ buffer_pool_bytes_dirty buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL buffer_pool_pages_free buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled value Buffer pages currently free (innodb_buffer_pool_pages_free) buffer_pages_created buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of pages created (innodb_pages_created) buffer_pages_written buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of pages written (innodb_pages_written) -buffer_index_pages_written buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of index pages written (innodb_index_pages_written) -buffer_non_index_pages_written buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of non index pages written (innodb_non_index_pages_written) buffer_pages_read buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of pages read (innodb_pages_read) buffer_pages0_read buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of page 0 read (innodb_pages0_read) buffer_index_sec_rec_cluster_reads buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of secondary record reads triggered cluster read