Resource Control: How to View Session-Level Variables

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

Original topic: resource control, 如何查看session级别变量

| username: ShawnYan

[TiDB Usage Environment] Production Environment / Testing / POC
[TiDB Version]
[Reproduction Path] What operations were performed when the issue occurred
[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]

Resource control management has been enabled. You can bind the current session to a specific resource group using the following command:

SET RESOURCE GROUP rg1;

But how (which command) can you check if the current session is bound to a specific resource group? Or how can you confirm that it has been successfully bound?

| username: db_user | Original post link

The processlist should be able to check it out, right?

| username: ShawnYan | Original post link

Very useful, thank you.

By the way, is there a difference between empty and default? There shouldn’t be, right?

mysql> SET RESOURCE GROUP `default`;
Query OK, 0 rows affected (0.00 sec)

mysql> select USER, RESOURCE_GROUP from INFORMATION_SCHEMA.processlist;
+------+----------------+
| USER | RESOURCE_GROUP |
+------+----------------+
| root | default        |
+------+----------------+
1 row in set (0.01 sec)

mysql> SET RESOURCE GROUP ``;
Query OK, 0 rows affected (0.00 sec)

mysql> select USER, RESOURCE_GROUP from INFORMATION_SCHEMA.processlist;
+------+----------------+
| USER | RESOURCE_GROUP |
+------+----------------+
| root |                |
+------+----------------+
1 row in set (0.00 sec)
| username: db_user | Original post link

It seems to mean the same thing here, not particularly clear.

| username: ShawnYan | Original post link

To supplement the related implementation:

| username: system | Original post link

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