Resource Control, Hint -- RESOURCE_GROUP, Documentation Discrepancy?

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

Original topic: resource control, hint – RESOURCE_GROUP, 文档表述偏差?

| username: ShawnYan

11

In fact, if the specified resource group does not exist, the hint is not ignored, but the statement will not be executed and an error will be returned.

12

mysql> SELECT /*+ RESOURCE_GROUP(rg21) */ count(*) FROM t ;
ERROR 8249 (HY000): Unknown resource group 'rg21'

Is there a discrepancy in the documentation? Please confirm.

@Billmay表妹 could u help?

| username: 我是咖啡哥 | Original post link

V7.1 indeed reports an error, which has both pros and cons… It feels better to give a warning prompt.

V6.4 gives a warning prompt.

root@[test]>SELECT /*+ RESOURCE_GROUP(rg21) */ count(*) FROM t ;
+----------+
| count(*) |
+----------+
|        0 |
+----------+
1 row in set, 1 warning (0.01 sec)

root@[test]>show warnings;
+---------+------+-----------------------------------------------------------------------+
| Level   | Code | Message                                                               |
+---------+------+-----------------------------------------------------------------------+
| Warning | 8061 | Optimizer hint RESOURCE_GROUP is not supported by TiDB and is ignored |
+---------+------+-----------------------------------------------------------------------+
1 row in set (0.01 sec)

root@[test]>select version();
+--------------------+
| version()          |
+--------------------+
| 5.7.25-TiDB-v6.4.0 |
+--------------------+
1 row in set (0.00 sec)
| username: ShawnYan | Original post link

I reviewed it again, and it’s just that the documentation is not very accurate. If it is ignored, the SQL can be executed.

In fact, if it does not exist, an error is thrown and the SQL execution is interrupted.

| username: redgame | Original post link

Oh… it looks like an issue with the hint rules.

| username: ShawnYan | Original post link

Brother, you’re using version 6.4. At that time, the resource group feature wasn’t available yet, right?

| username: li_zhenhuan | Original post link

This should be a documentation prompt issue, I’ll provide feedback.

| username: Billmay表妹 | Original post link

Feedback provided~ I will update you with any progress~

| username: Billmay表妹 | Original post link

Created an issue to track this on Query execution failed with not exist ResourceGroup() hint · Issue #45178 · pingcap/tidb · GitHub and will fix it as soon as possible. Thanks for the feedback.

| username: ShawnYan | Original post link

Thanks, I didn’t expect to encounter functionality issues after the upgrade.

| username: system | Original post link

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