mysql - mysql mariadb 中的 query_cache_min_res_unit 是什么?

标签 mysql sql innodb mariadb

设置查询缓存时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/

相关文章:

mysql - 选择重复项会为每个查询提供不同的结果计数

mysql - 如果标记已存在,则将行追加到配置标记

sql - RDB 中的子关系

mysql - 在 Lustre 文件系统上启动 Mysqld 的持续时间太长(InnoDB : Unable to lock ./ibdata1,错误:38)

sql - 比较SQL Server中的两个字符串

mysql - 将返回重复彩票号码的 SQL 查询

php - 如何在 PHPMyAdmin 中启用 "Relation view"功能

mysql - 第 1 行出现错误 1064 (42000)

c# - 从 Mysql DB C# 旋转 block 引用

MYSQL 动态选择循环