设置查询缓存时mysql中的query_cache_min_res_unit选项是什么。另外,当我在互联网上阅读有关 query_cache_min_res_unit 的内容时,我看到了一个词 block,但我不明白这个词 block 的含义。
谁能用简单易行的话告诉我这两个词的含义以及在哪里以及为什么使用这两个词?
最佳答案
看这里: https://mariadb.com/kb/en/mariadb/query-cache/
它说:
There are two main ways to limit the size of the query cache. First, the overall size in bytes is determined by the query_cache_size server variable. About 40KB is needed for various query cache structures.
The query cache size is allocated in 1024 byte-blocks, thus it should be set to a multiple of 1024.
The query result is stored using a minimum block size of query_cache_min_res_unit. Check two conditions to use a good value of this variable: Query cache insert result blocks with locks, each new block insert lock query cache, a small value will increase locks and fragmentation and waste less memory for small results, a big value will increase memory use wasting more memory for small results but it reduce locks. Test with your workload for fine tune this variable.
关于mysql - mysql mariadb 中的 query_cache_min_res_unit 是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44994669/