summaryrefslogtreecommitdiff
path: root/storage/innobase/include/dict0dict.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/dict0dict.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/dict0dict.h')
-rw-r--r--storage/innobase/include/dict0dict.h18
1 files changed, 1 insertions, 17 deletions
diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h
index 49e884d064d..7351b5fb682 100644
--- a/storage/innobase/include/dict0dict.h
+++ b/storage/innobase/include/dict0dict.h
@@ -1459,7 +1459,7 @@ UNIV_INLINE
rw_lock_t*
dict_index_get_lock(
/*================*/
- dict_index_t* index) /*!< in: index */
+ const dict_index_t* index) /*!< in: index */
MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Returns free space reserved for future updates of records. This is
@@ -1524,22 +1524,6 @@ void
dict_mutex_exit_for_mysql(void);
/*===========================*/
-/** Lock the appropriate latch to protect a given table's statistics.
-@param[in] table table whose stats to lock
-@param[in] latch_mode RW_S_LATCH or RW_X_LATCH */
-void
-dict_table_stats_lock(
- dict_table_t* table,
- ulint latch_mode);
-
-/** Unlock the latch that has been locked by dict_table_stats_lock().
-@param[in] table table whose stats to unlock
-@param[in] latch_mode RW_S_LATCH or RW_X_LATCH */
-void
-dict_table_stats_unlock(
- dict_table_t* table,
- ulint latch_mode);
-
/********************************************************************//**
Checks if the database name in two table names is the same.
@return TRUE if same db name */