There is an anomaly in the statistical results of the delete counter in TiDB monitoring

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

Original topic: tidb监控中-delete计数器的统计结果有异常

| username: xxxxxxxx

Version: TiDB 4.0.13
GC Time: 2h
Concurrency: 5

Question 1: When cleaning data, the business found some issues with the monitoring statistics. The delete operation statistics always show 0, even though several thousand delete operations have been performed. I would like to understand what the issue is and where this delete counter is obtained from.

Question 2: There is a small issue with the dashboard filter function. In the first image, no database is selected, and it shows all delete operations. In the second image, after selecting the database name, it only shows three delete operations, but in reality, most of the deletes are generated by this database, and the generation time is within the last two hours.

| username: xfworld | Original post link

What are the descriptions of these delete transactions?
Is it one transaction per SQL statement
or one transaction for N SQL statements?

It is recommended to check the QPS metric information on the TiDB panel

  • QPS: The number of SQL statements executed per second on all TiDB instances, categorized by SELECT, INSERT, and UPDATE types.


You can compare it.

| username: xxxxxxxx | Original post link

Business cleaning involves a single delete SQL per transaction, with 5 concurrent threads.

| username: jansu-dev | Original post link

  1. It might be due to the Prometheus expression, where the total number of occurrences within a time interval divided by the time interval will have an averaging effect. You can try replacing rate with irate or increase to see if it meets your expectations. Principle → http://www.dbnest.net/docs/DB-TIDB/Class-01-TiDB之Prometheus#62-increase

  2. Where is the delete counter? In the dispatch part, theoretically, it should not be missed as all SQL will go through the dispatch code block. Also, no related issues were found on GitHub.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. No new replies are allowed.