This topic describes how to specify a resource group to execute a query in AnalyticDB.
Methods
Enterprise Edition, Basic Edition, or Data Lakehouse Edition
By default, each cluster has a Job resource group named serverless (supported only in v3.2.2.8 and later) and an Interactive resource group named user_default. If no other resource groups exist, XIHE queries are executed in the user_default resource group, and Spark application queries are executed in the serverless resource group. To isolate resources for queries, you can create new resource groups and specify them for different types of queries.
XIHE SQL
Submission method | Method to specify a resource group |
Submit XIHE SQL using Java Database Connectivity (JDBC) | You can specify a resource group to execute the query in one of the following three ways.
The priority of the methods to specify a resource group is as follows, from highest to lowest: hint, attached resource group, and default resource group. |
Spark SQL and Spark applications
Submission method | Method to specify a resource group |
Submit a Spark SQL query or a Spark application on the job developer page | You can manually select a resource group on the job developer page in the console. In this case, you cannot specify a resource group using a hint or by attaching a resource group. |
Submit a Spark application using the Spark-Submit tool, a Notebook, or an SDK |
|
Submit a Spark application using OpenAPI | Specify a resource group using the ResourceGroupName parameter of the SubmitSparkApp operation. |
Data Warehouse Edition
You can specify a resource group to execute the query in one of the following three ways.
Specify a resource group using a hint:
/*+resource_group=resourceGroupName*/.Specify a resource group by attaching a resource group to a database account.
If you do not explicitly specify a resource group, the query uses the default user_default resource group.
The priority of the methods to specify a resource group is as follows, from highest to lowest: hint, attached resource group, and default resource group.