TiDB Query Cache

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: tidb查询缓存

| username: TiDBer_QHSxuEa1

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?

| username: tidb菜鸟一只 | Original post link

EXPLAIN ANALYZE your SQL

| username: MrSylar | Original post link

I guess the question is about Coprocessor Cache | PingCAP Documentation Center

| username: redgame | Original post link

Explain the results, cop[tikv]: Is there something similar to this?

| username: hey-hoho | Original post link

You can refer to the Coprocessor Cache in the execution plan.

| username: zhanggame1 | Original post link

You can see with EXPLAIN ANALYZE

| username: ljluestc | Original post link

---[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}
| username: TiDBer_QHSxuEa1 | Original post link

Found it, thank you.

| username: TiDBer_QHSxuEa1 | Original post link

Okay, found it, thank you.

| username: TiDBer_QHSxuEa1 | Original post link

Got it, thanks.

| username: TiDBer_QHSxuEa1 | Original post link

Okay, thank you.

| username: TiDBer_QHSxuEa1 | Original post link

Got it, thanks for the explanation.