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
Change the limits for a resource group.
ALTER RESOURCE GROUP name SET group_attribute value;
Where group_attribute is as follows:
CONCURRENCY integer
CPU_RATE_LIMIT integer
CPUSET tuple
MEMORY_LIMIT integer
MEMORY_SHARED_QUOTA integer
MEMORY_SPILL_RATIO integer
ALTER RESOURCE GROUP Changes the limits for a resource group. Only superusers can modify resource groups.
Users can set or reset the parallelism limit for resource groups that control the maximum activity parallelism of the role. Users can also control the total amount of memory or CPU that all queries submitted through the resource group can be used on each Segment host by resetting memory or CPU resources for the resource group.
When a user changes the mode or limit of the resource group CPU resource, the new mode or limit will take effect immediately.
When the user changes the memory limit for the resource group created by the role, the new resource limit is applied immediately if the current resource usage is less than or equal to the new value and there are no running transactions in the resource group. If the current resource usage exceeds the new memory limit value, or if there is a running transaction in another resource group that holds certain resources, the YMatrix database delays allocating a new limit until the resource usage falls within the range of the new value.
When the user promotes the memory limit of the resource group created for external components, the new resource limit takes effect as the resource becomes available. If the user lowers the memory limit for resource groups created for external components, the performance is based on the specific component. For example, if the user reduces the memory limit for resource groups created for the PL/Container runtime, the query in the running container may fail with an out of memory error.
Users can change the type of restriction in a single ALTER RESOURCE GROUP call.
name
CONCURRENCY integer
CPU_RATE_LIMIT integer
CPUSET tuple
MEMORY_LIMIT integer
MEMORY_SHARED_QUOTA integer
MEMORY_SPILL_RATIO integer
Use CREATE ROLE or ALTER ROLE to assign a specified resource group to a role (user).
Users cannot submit ALTER RESOURCE GROUP commands in explicit transactions or subtransactions.
Change the active transaction limits for resource groups:
ALTER RESOURCE GROUP rgroup1 SET CONCURRENCY 13;
Update CPU limits for resource groups:
ALTER RESOURCE GROUP rgroup2 SET CPU_RATE_LIMIT 45;
Update memory limits for resource groups:
ALTER RESOURCE GROUP rgroup3 SET MEMORY_LIMIT 30;
Improve the memory overflow rate of resource groups from the default values:
ALTER RESOURCE GROUP rgroup4 SET MEMORY_SPILL_RATIO 25;
Reserving CPU cores for resource groups 1:
ALTER RESOURCE GROUP rgroup5 SET CPUSET '1';
The ALTER RESOURCE GROUP statement is an extension of the YMatrix database and does not have this command in the PostgreSQL standard.