Query_cache_min_res_unit; What is it and what is it doing?

I am setting up a cache in MySQL.

Can someone explain query_cache_min_res_unit ? What does he do, etc.

I read the manual and did not explain very well.

Details appreciated ... Or examples ...

thanks

+6
sql database php mysql caching
source share
1 answer

query_cache_min_res_unit is a variable that can be used for optimization queries, depending on the large result sets that you can work with.

By definition, a value is the minimum amount of memory that MySQL will allocate to store a query.

You want this value to be approximately equal to the average request size. Each database has different values ​​for a minimum, depending on how many sets you work with.

Here is my:

 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 on MySQL Query Cache Optimization

+6
source share

All Articles