summaryrefslogtreecommitdiff
path: root/storage/innobase/include/btr0btr.h
diff options
context:
space:
mode:
authorEugene Kosov <claprix@yandex.ru>2020-10-27 12:24:55 +0300
committerEugene Kosov <claprix@yandex.ru>2020-10-27 19:09:20 +0300
commitafc9d00c66db946c8240fe1fa6b345a3a8b6fec1 (patch)
tree6046d3f57efbdb10767daaf3238af9d0bf07434c /storage/innobase/include/btr0btr.h
parent42e1815ad850384fad292534665ff61b78dd96f6 (diff)
downloadmariadb-git-afc9d00c66db946c8240fe1fa6b345a3a8b6fec1.tar.gz
MDEV-23991 dict_table_stats_lock() has unnecessarily long scope
Patch removes dict_index_t::stats_latch. Table/index statistics now protected with dict_sys->mutex. That way statistics computation can happen in parallel in several threads and dict_sys->mutex will be locked only for a short period of time. This patch is a joint work with Marko Mäkelä dict_index_t::lock: make mutable which allows to pass const pointer when only lock is touched in an object btr_height_get() btr_get_size(): make index argument const for better type safety btr_estimate_number_of_different_key_vals(): now returns computed values instead of setting fields in dict_index_t directly remove everything related to dict_index_t::stats_latch dict_stats_index_set_n_diff(): now returns computed values instead of setting fields in dict_index_t directly dict_stats_analyze_index(): now returns computed values instead of setting fields in dict_index_t directly Reviewed by: Marko Mäkelä
Diffstat (limited to 'storage/innobase/include/btr0btr.h')
-rw-r--r--storage/innobase/include/btr0btr.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/storage/innobase/include/btr0btr.h b/storage/innobase/include/btr0btr.h
index 5bc0b70714c..29ece955702 100644
--- a/storage/innobase/include/btr0btr.h
+++ b/storage/innobase/include/btr0btr.h
@@ -213,7 +213,7 @@ the index.
ulint
btr_height_get(
/*===========*/
- dict_index_t* index, /*!< in: index tree */
+ const dict_index_t* index, /*!< in: index tree */
mtr_t* mtr) /*!< in/out: mini-transaction */
MY_ATTRIBUTE((warn_unused_result));
@@ -585,7 +585,7 @@ Gets the number of pages in a B-tree.
ulint
btr_get_size(
/*=========*/
- dict_index_t* index, /*!< in: index */
+ const dict_index_t* index, /*!< in: index */
ulint flag, /*!< in: BTR_N_LEAF_PAGES or BTR_TOTAL_SIZE */
mtr_t* mtr) /*!< in/out: mini-transaction where index
is s-latched */