Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: tidb 慢日志 内存使用
Consult about memory usage information for slow SQL.
Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: tidb 慢日志 内存使用
Consult about memory usage information for slow SQL.
The page states that it is the memory space occupied by the current SQL query.
Yesterday this SQL might have returned 1000 rows of data, but this year it might return 3000 rows of data.
The SQL executed yesterday and the SQL executed today are not shown as the same in the slow log.
I am looking at each one accurately. The memory usage should ideally just write the memory occupied by SQL execution, which is easier to understand.
Check the memory recorded for this SQL in tidb.log or cluster_slow_query.
Well, I just want to know if this maximum memory is the actual memory used.
Once? Wasn’t this SQL used? A single SQL should only be displayed once in the dashboard, right?
Memory usage resembles a wavy line, reflecting the peak usage at its highest point.
During the execution of an SQL statement, multiple nodes will use memory. Does this show the maximum memory of a single node, or the total memory used by all nodes?
Hello, the maximum memory here refers to the memory of the operator that uses the most memory among all operators, corresponding to the memory field in the execution plan above.
Hello, according to your explanation, how should the total memory occupied by this SQL be calculated when it is executed? Should we sum up the memory usage of all operators? After all, a SQL statement usually uses multiple operators.
This cannot be calculated precisely, only an approximate value can be estimated. You can calculate it by summing up the memory fields, but it is not possible to trace the memory usage of some types of operators.
Sure, thank you for the explanation.
By identifying the operator that uses the most memory, we can further analyze and optimize the SQL.
This topic will be automatically closed 60 days after the last reply. No new replies are allowed.