Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: resource control, hint – RESOURCE_GROUP, 文档表述偏差?

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.

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?
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)
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.
Oh… it looks like an issue with the hint rules.
Brother, you’re using version 6.4. At that time, the resource group feature wasn’t available yet, right?
This should be a documentation prompt issue, I’ll provide feedback.
Feedback provided~ I will update you with any progress~
Thanks, I didn’t expect to encounter functionality issues after the upgrade.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.