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?
You also need to enable the query cache by adding
query_cache_type=1to your configuration: