Configure Query Engine resource groups
Keep one workload from taking all the resources of your Query Engine. Resource groups limit the concurrency, queue, memory, and CPU of each group of workloads on the Trino cluster, and selector rules decide which group runs each query.
Prerequisites
- A Query Engine whose Status is Healthy. See Create a Query Engine service.
- To store the configuration in a database: a PostgreSQL database, with its host, port, database name, username, and password.
Open the Resource Groups tab
- Select Data platform → Workspace management, then select your workspace.
- On the Overview tab, under Services, select Query engine.
- Select the Resource Groups tab.
Until you enable resource groups, the tab shows only a short description and an Enable button. The description says that resource groups limit resource usage and can enforce queueing policies on the queries that run in them.

After you enable them, the Resource Groups tab shows three tabs of its own: Details, Selector Rules, and Configuration.
Enable resource groups
- On the Resource Groups tab, select Enable.
- In the Enable resource groups panel, select a Source. Default: File.

| Source | Description |
|---|---|
| File | A local configuration file on the coordinator. No other fields. |
| Database | A database stores the configuration. The panel shows the connection fields below. |
If you select Database, fill in the connection fields.

| Field | Description |
|---|---|
| Type | The database type. Supported: PostgreSQL. |
| Host | The IP address or hostname of the database server. |
| Port | The connection port, from 1 to 65535. |
| Database Name | The database that stores the resource group configuration. |
| Username | The username of the database. |
| Password | The password of the database. Select the eye icon to show or hide it. |
- Optional: for a Database source, select Test connection to check the connection before you save. The panel confirms the connection or shows the error.
- Select Save. To close the panel without enabling resource groups, select Cancel.
The panel closes, and the Details tab shows the resource group tree.
Manage resource groups
The Details tab shows the resource group tree on the left. Select a group to see its settings on the right, under the Add Sub-group, Edit, and Delete buttons.

| Section | Fields |
|---|---|
| Concurrency & Queue | Soft concurrency limit, Hard Concurrency Limit, and Max Queued. |
| Resource limit | Soft cpu limit, Hard cpu limit, and Soft Memory Limit. |
| Scheduling | Scheduling policy, Scheduling Weight, and JMX Export. |
Changes to the tree are not applied right away. They wait until you select Apply change. See Apply or cancel changes.
Create a resource group
- On the Details tab, select the + icon next to Resource Groups.
- In the Create resource group panel, fill in the fields.
- Select Create.

| Field | Description |
|---|---|
| Name | Required. Up to 250 characters. You can use the templates ${USER} and ${SOURCE}. |
| Max Queued | Required. The maximum number of queries that can wait in the queue. Minimum: 0. |
| Soft concurrency limit | Optional. Must be less than or equal to Hard Concurrency Limit. |
| Hard Concurrency Limit | Required. The maximum number of queries that can run at the same time. Minimum: 1. |
| Soft cpu limit, Hard cpu limit | Optional. When you enter both, Hard cpu limit must be greater than Soft cpu limit. |
| Soft Memory Limit | Required. A percentage, for example 50%, or a size, for example 10GB or 500MB. |
| JMX Export | Optional. True or False. Default: False. |
| Scheduling policy | Optional. fair, weighted, weighted_fair, or query_priority. Default: fair. |
| Scheduling Weight | Optional. Takes effect only when Scheduling policy is weighted or weighted_fair. |
The new group appears in the tree, and Apply change and Cancel appear at the bottom right.
Add a sub-group
- In the tree, select the parent group.
- Select Add Sub-group.
- Fill in the fields of the sub-group. See the field table in Create a resource group.
- Select Create.
The sub-group appears in the tree, indented under its parent.
Edit a resource group
- In the tree, select the group.
- Select Edit.
- In the Edit resource group panel, change the fields. The panel opens with the current values.
- Select Save.

The group shows the new values, and Apply change and Cancel appear.
Delete a resource group
Deleting a group also deletes all of its sub-groups. After you select Apply change, the deletion cannot be undone.
- In the tree, select the group.
- Select Delete.
- In the Delete resource group dialog, select Confirm.

The group and all of its sub-groups disappear from the tree, and Apply change and Cancel appear.
Apply or cancel changes
The changes you make in the tree are kept as pending changes until you apply or cancel them.
- Select Apply change to send all pending changes to the Trino coordinator. This takes up to 30 seconds.
- Select Cancel to discard all pending changes. The tree goes back to its state after the last apply.
Manage selector rules
Selector rules route each query to a resource group. The rules are checked in order and the first rule that matches wins. A query matches a rule only when it meets every condition of the rule.
The Selector Rules tab lists the rules in a table with the columns User match, Source, Query type, Client tags, Target group, and Action.
Create a selector rule
- On the Selector Rules tab, select Add selector rule at the top right.
- In the Create selector rule panel, select a Type. The field for that type appears next to it.
- Enter the value of the condition.
- Optional: add conditions in Client tags and Query type.
- Select the Resource group that receives the matching queries.
- Select Create.

Fill in at least one condition: User, User group, Source, Query type, or Client tags.
| Field | Description |
|---|---|
| Type | Optional. Select it to add a User, User group, or Source condition. The field for that condition appears next to it. |
| User | Optional. A regex pattern that matches the username. Up to 512 characters. |
| User group | Optional. The name of a user group. |
| Source | Optional. A regex pattern that matches the source of the connection. Up to 512 characters. |
| Query type | Optional. The type of query, for example SELECT, INSERT, DELETE, UPDATE, or DATA_DEFINITION. |
| Client tags | Optional. A list of tags. Up to 20 tags, each up to 128 characters. |
| Resource group | Required. The resource group that receives the matching queries. |
The rule appears in the table, and Apply change and Cancel appear. See Apply or cancel changes.
Edit a selector rule
- In the row of the rule, select the edit icon (pencil) in the Action column.
- In the Edit selector rule panel, change the fields. The panel opens with the current values.
- Select Save.

The table shows the new values, and Apply change and Cancel appear.
Delete a selector rule
- In the row of the rule, select the delete icon (trash can) in the Action column.
- In the Delete selector rule dialog, select Confirm.

The rule disappears from the table, and Apply change and Cancel appear. The dialog warns that the deletion cannot be undone.
Change the configuration source
The Configuration tab shows where the resource group configuration is stored, and lets you switch between the File and Database sources.

| Section | Fields |
|---|---|
| Configuration | Type (File or Database), Database url, Username, and Password, which is masked. |
| Global properties | CPU Quota Period. |
Switching the source restarts the coordinator for about 30 to 90 seconds and terminates the active queries. The resource groups and selector rules are kept.
- On the Configuration tab, select Edit.
- In the Enable resource groups panel, select the new Source. The panel opens with the current source selected.
- If you select Database, fill in the connection fields. See Enable resource groups.
- Select Save.

The portal migrates the configuration. When it is done, the Configuration tab shows the new source as the Type.
Disable resource groups
Disabling resource groups can cause performance degradation or resource contention across workloads, and it cannot be undone in the portal. To use resource groups again, select Enable and set up the whole configuration from the start.
- On the Details, Selector Rules, or Configuration tab, select Disable at the top right.
- In the Disable resource groups dialog, select Confirm.

The Resource Groups tab goes back to the empty state with the Enable button.