How to query the source of select threads in QPS under the Tidb option in Grafana?

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

Original topic: Grafana中Tidb选项中的QPS里面的select线程如何查询来源?

| username: TiDBer_y9IRzLWc

[TiDB Usage Environment] Production Environment / Testing / PoC
[TiDB Version]
[Reproduction Path] What operations were performed that led to the issue
[Encountered Issue: Issue Phenomenon and Impact]
[Resource Configuration] Go to TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page
[Attachments: Screenshots/Logs/Monitoring]

Currently, it is known that the TiDB cluster has no other business performing query operations, but we see quite a few select query threads here. Could you please explain the reason for these select queries?

| username: 像风一样的男子 | Original post link

Opening the dashboard and monitoring will generate select queries.

| username: TiDBer_y9IRzLWc | Original post link

Oh, got it, thank you.

| username: DBRE | Original post link

Enable the general log on each TiDB instance to check the actual executed SQL:

set tidb_general_log = 1;
| username: redgame | Original post link

You can determine the source of the select thread by checking the labels (Label) or the WHERE clause in the query statement.

| username: zhanggame1 | Original post link

The Dashboard can view the executed SQL. Generally speaking, there are SQLs with statistical information running continuously, many of which are SELECT statements.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.