Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: tidb查询缓存
I would like to ask everyone, regarding the caching of TiDB query results, how can I check if an SQL query has hit the cache? Can I manually clear the query cache?
Explain the results, cop[tikv]: Is there something similar to this?
You can refer to the Coprocessor Cache in the execution plan.
You can see with EXPLAIN ANALYZE
---[CONNECTION]
id | 5b8a6d67-b8d6-443b-9c8a-d6197e58399a
address | 192.168.1.100:3306
---[QUERY]
select * from students where age > 25;
---[EXECUTION PLAN]
Projection_5 | 3.80 | root |
└─Selection_4 | 3.80 | root |
└─TableScan_3 | 10000.00| root |
└─TiKV | 10000.00| cop[tikv] | task: {total_time: 1.0027919s, fetch: 25.56ms, cache_hit_ratio: 1.00}
Okay, found it, thank you.
Got it, thanks for the explanation.