diff options
author | Vladislav Vaintroub <wlad@mariadb.com> | 2020-07-08 17:38:59 +0200 |
---|---|---|
committer | Vladislav Vaintroub <wlad@mariadb.com> | 2020-07-14 11:16:24 +0200 |
commit | 1a2b494100e5a81c8ac568899d66884b9936cf98 (patch) | |
tree | 112d70b6876543706bd87deea4fec006ec400815 /sql/mysqld.cc | |
parent | 7148b846738412517bf4998128ba66a277721630 (diff) | |
download | mariadb-git-1a2b494100e5a81c8ac568899d66884b9936cf98.tar.gz |
MDEV-23124 Eliminate the overhead of system call access() on every USE(or connection)
Make check_db_dir_existence() use a cache of existing directories
clear the cache whenever any directory is removed.
With this, the cost of check_db_dir_existence() will usually be a cost of
acquiring/releasing a non-contended readwrite lock in shared mode,
much less than going to the kernel and filesystem to check for file existence
Diffstat (limited to 'sql/mysqld.cc')
-rw-r--r-- | sql/mysqld.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 40c7d78e98b..63949c6a49c 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -9031,6 +9031,7 @@ PSI_memory_key key_memory_binlog_ver_1_event; PSI_memory_key key_memory_bison_stack; PSI_memory_key key_memory_blob_mem_storage; PSI_memory_key key_memory_dboptions_hash; +PSI_memory_key key_memory_dbnames_cache; PSI_memory_key key_memory_errmsgs; PSI_memory_key key_memory_frm_string; PSI_memory_key key_memory_gdl; @@ -9331,6 +9332,7 @@ static PSI_memory_info all_server_memory[]= { &key_memory_THD_handler_tables_hash, "THD::handler_tables_hash", 0}, { &key_memory_hash_index_key_buffer, "hash_index_key_buffer", 0}, { &key_memory_dboptions_hash, "dboptions_hash", 0}, + { &key_memory_dbnames_cache, "dbnames_cache", 0}, { &key_memory_user_conn, "user_conn", 0}, // { &key_memory_LOG_POS_COORD, "LOG_POS_COORD", 0}, // { &key_memory_XID_STATE, "XID_STATE", 0}, |