Updated on 2023-03-30 GMT+08:00

Space Control

Description

User space management includes permanent tablespace management, temporary tablespace management, and intermediate calculation result set flushing space management. When creating group users and service users, the database administrator can specify the permanent tablespace, temporary tablespace, and intermediate calculation result set flushing space limit. When a user's operation involves the increase or decrease of the managed space, the system checks whether the space exceeds the specified limit. If the space exceeds the limit, the user is not allowed to perform the operation and the available disk space is limited to the specified space limit.

In addition, the product supports schema-based permanent space control. When the space of objects in a schema are added or deleted, the operations that exceed the limit are controlled.

Technical Principles

When a service user executes a service, the size of the data space operated by the service user is recorded in the space quota of the service user. For a permanent tablespace, the quota is evenly allocated to each DN. DNs collect space statistics in real time when data files, temporary table files, and temporary files are added or expanded. When a service user performs a service operation, DNs check whether the space limit is reached and determine whether to perform the operation. If the space limit is exceeded, DNs roll back the operation. When a transaction or session ends, the space is released and the corresponding value is updated.

DNs collect statistics on disk changes involved in user operations in real time, save the statistics to the memory, wait for the CN to collect the statistics, and receive the information delivered by the CN to update the temporary space used by the entire system.

Benefits

By limiting the maximum storage space used by a user, the system prevents user services from squeezing or occupying too many storage resources to ensure that normal service data can be written, ensuring system stability and data availability.

For more information, see "Space Control"