YMatrix
Quick Start
Simulate Time Series Scenarios
Standard Cluster Deployment
Data Modeling
Connecting to The database
Data Writing
Data Migration
Data Query
Scene Application Examples
Federal Query
Maintenance and Monitoring
Global Maintenance
Partition Maintenance
Backup and Restore
Cluster Expansion
Monitoring
Performance Tuning
Troubleshooting
Reference Guide
Tool Guide
Data Type
Storage Engine
Execution Engine
Configuration Parameters
Index
Extension
SQL Reference
FAQ
Delete the resource group.
DROP RESOURCE GROUP group_name
This command deletes the resource group from the YMatrix database. Only superusers can delete resource groups. When a resource group is deleted, the memory and CPU resources retained by the group are recycled to the YMatrix database.
To delete a role resource group, you cannot assign the group to any roles, and you cannot have any pending or running statements in the group. If you delete a resource group created for an external component, the behavior is determined by the external component. For example, deleting a resource group assigned to the PL/Container runtime kills the running containers in the group.
You cannot delete predefined admin_group and default_group resource groups.
group_name
You cannot submit a DROP RESOURCE GROUP command in an explicit transaction or a subtransaction.
Use ALTER ROLE to delete resource groups assigned to specific users/role.
Perform the following query to view all currently active queries for all resource groups:
SELECT usename, current_query, waiting, procpid,
rsgid, rsgname, rsgqueueduration
FROM pg_stat_activity;
To view resource group allocation, perform the following query on the pg_roles and pg_resgroup system catalog tables:
SELECT rolname, rsgname
FROM pg_roles, pg_resgroup
WHERE pg_roles.rolresgroup=pg_resgroup.oid;
Delete the resource group assigned to the role. This action then assigns the default resource group default_group to the role:
ALTER ROLE bob RESOURCE GROUP NONE;
Delete the resource group named adhoc:
DROP RESOURCE GROUP adhoc;
The DROP RESOURCE GROUP statement is a YMatrix database extension.