I am setting up cache in MySQL.
Could someone please explain query_cache_min_res_unit
?
What does it do etc?
I have read the manual and it doesn't explain so good.
Details are appreciated... Or examples...
Thanks
I am setting up cache in MySQL.
Could someone please explain query_cache_min_res_unit
?
What does it do etc?
I have read the manual and it doesn't explain so good.
Details are appreciated... Or examples...
Thanks
query_cache_min_res_unit
is a variable which may be used for optimization queries, depending on large of result sets you may be working with.
By definition, the value is the minimum amount of memory MySQL will allocate to store a query.
You would want the this value to be roughly the average query size. Each database has different values for the minimum, depending on how large of sets you are working with.
Here is mine:
mysql> show variables like "query%";
+------------------------------+---------+
| Variable_name | Value |
+------------------------------+---------+
| query_alloc_block_size | 8192 |
| query_cache_limit | 1048576 |
| query_cache_min_res_unit | 4096 |
| query_cache_size | 0 |
| query_cache_type | ON |
| query_cache_wlock_invalidate | OFF |
| query_prealloc_size | 8192 |
+------------------------------+---------+
7 rows in set (0.25 sec)
As you can see, my minimum value is 4096 bytes.
As a follow-up, you can read more at Optimizing the MySQL Query Cache