当前位置:网站首页>MySQL table cache most detailed notes

MySQL table cache most detailed notes

2022-06-13 07:36:00 Fish is not fish

Parameters :

table_open_cache File handle , The descriptor fd,
table_definition_cache Metadata ,.frm file , Load once during initialization .

The status value :

Open_tables. Number of currently open tables , By command show open tables see . The system tables will be cached for the first time .
Opened_tables adopt my_open() Number of tables opened by function
Open_table_definitions The number of definitions of the currently open table , cache .frm file
Opened_table_definitions. Total number of definitions of open tables

Table_open_cache_hits
Table_open_cache_misses About equal to Opened_tables
Table_open_cache_overflows

Monitoring item

table_open_cache shooting : Table_open_cache_hits/(Table_open_cache_hits+Table_open_cache_misses) But it must be calculated from the beginning

table cache Operation process

1. for the first time open file , Will file fd Load into table cache
2. Next, you need to open When you file , First judge whether you are open_cache in , If you are Table_open_cache_hits +1 If not Table_open_cache_misses +1 Will apply for fd Put it in the kernel cache
3. If table cache The number of caches in it has reached table_open_cache Value , Need to be eliminated , If it is eliminated Table_open_cache_overflows +1

Definition

table cache: Table total cache
table_open_cache: Limit the number of openings inside , File match

Mode of expulsion

1.cache Full of , The table opened by the new connection is not in it ,
2.cache The number of table_open_cache value , Then when the table inside is no longer used
3.flush tables Will table_open_cache table_def_cache Expel all
cache Full of eviction principle :
1. Unused tables LRU

原网站

版权声明
本文为[Fish is not fish]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202270547441939.html