QC_Hit : no for all the queries logged in my slow query log

816 Views Asked by At

Following is a sample line from my slow query log:

>Thread_id: 478  Schema: schema_one  QC_hit: No
>
>Query_time: 3.725316  Lock_time: 0.000030  Rows_sent: 10  Rows_examined: 442611
>
>Rows_affected: 0  Bytes_sent: 2703

For all the queries running in the server, the QC_hit is No only!. But I have set almost 16M for the query cache.

Updated: I am using 10.4.17-MariaDB.

Do the settings or my code affecting the cache?

1

There are 1 best solutions below

3
markusjm On

You also need to enable the query cache by adding query_cache_type=1 to your configuration:

To see if the cache is enabled, view the query_cache_type server variable. It is enabled by default in MariaDB versions up to 10.1.6, but disabled starting with MariaDB 10.1.7 - if needed enable it by setting query_cache_type to 1.