Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: 如何查看一个SQL里面涉及到了多少key?
Which monitoring metric can reflect how many keys or rows are included in an SQL statement?
Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: 如何查看一个SQL里面涉及到了多少key?
Which monitoring metric can reflect how many keys or rows are included in an SQL statement?
Use EXPLAIN SELECT * FROM a;
to see the execution plan.
EXPLAIN ANALYZE
Generally, after adding an index, the number of keys scanned will be relatively fewer.
Sorry, maybe I didn’t express myself clearly. I meant the Grafana monitoring metrics for DML statements like insert, update, delete, not running specific statements.
Something like this? You can see the traffic visualization on the TiDB Dashboard.
No, this can only show the read and write status of the hotspot table, but it cannot determine how many keys a transaction has affected.
If it’s about transactions, then you must be referring to this.
Yes, this is the number of keys involved in a single transaction. What I want to ask is whether Grafana monitoring shows the total number of keys involved in the current period.
Is this it?
Transaction
- Transaction Regions Num: The number of Regions involved in the transaction operation
- Transaction Write KV Num: The number of KVs involved in the transaction operation
Distsql
- Scan Keys Num: The number of Keys scanned by each Query
- Scan Keys Partial Num: The number of Keys scanned by each Partial Result
This topic was automatically closed 1 minute after the last reply. No new replies are allowed.