All Products
Search
Document Center

Hologres:Adaptive serverless computing

Last Updated:Feb 07, 2026

When you run read and write tasks using serverless computing resources, some requests are unpredictable. These requests can instantly exhaust your computing resources and affect other tasks. Hologres continuously develops intelligent features to address this issue. Starting from V3.1, Hologres supports adaptive large task isolation. Starting from V4.1, it supports adaptive load isolation. These features automatically identify large tasks and dynamically use serverless resources to run them, improving system stability and resource utilization.

Hologres lets you run read and write tasks using serverless computing resources. You can predefine routing rules for SQL statements, users, or query queues to send known tasks to serverless resources. However, in production scenarios, some read and write requests are unpredictable. You may not know whether they will consume excessive computing resources, which user will initiate them, or what their classification features are. These requests can instantly consume all the computing resources of a virtual warehouse, affecting other read and write requests.

To address this scenario, Hologres continuously enhances its intelligent capabilities to support adaptive serverless computing.

  • Starting from V3.1, Hologres supports adaptive large task isolation. The system automatically identifies "large tasks" and runs them using serverless resources.

  • Starting from V4.1, Hologres supports adaptive load isolation. The system automatically adjusts the threshold for "large tasks" based on the current load and runs large tasks on serverless resources only when the load is high. This feature has no effect when the load is low.

How it works

As described in The amount of serverless resources used by an SQL statement, the amount of serverless resources is determined by the minimum of Quota, Max Cores, and Required Cores. Hologres can automatically estimate the Required Cores and determines the optimal amount of serverless computing resources for an SQL statement based on factors such as SQL complexity and the data volume of related tables.

Based on the optimal resource amount that Hologres automatically estimates for an SQL statement, you can define a resource threshold. SQL statements that exceed this threshold are defined as "large tasks." This enables the following adaptive serverless computing scenarios:

  • Adaptive large task isolation: You define a resource threshold for "large tasks." All "large tasks" automatically run on serverless resources.

  • Adaptive load isolation: The system dynamically adjusts the resource threshold for "large tasks" based on the load and runs "large tasks" on serverless resources only when the load is high.

Hologres supports two types of custom resource thresholds: a ratio threshold and an absolute threshold. An SQL statement automatically runs on serverless resources only when the system-estimated Required Cores value exceeds both thresholds: Required Cores > max(ratio threshold, absolute threshold). For the adaptive large task isolation feature, you can modify these two thresholds.

  • hg_adaptive_serverless_computing_min_resource_ratio_threshold: The ratio threshold coefficient. The default value is 0.3. For virtual warehouse instances, the ratio threshold is the ratio threshold coefficient × the compute resources of the virtual warehouse. For general-purpose instances, the ratio threshold is the ratio threshold coefficient × the compute resources of the instance.

  • hg_adaptive_serverless_computing_min_cores_threshold: The absolute threshold. The default value is 256, in CUs.

-- Modify at the session level
SET hg_adaptive_serverless_computing_min_resource_ratio_threshold = 0.3;
SET hg_adaptive_serverless_computing_min_cores_threshold = 256;

-- Modify at the user level
ALTER USER "<role_name>" IN DATABASE <db_name> SET hg_adaptive_serverless_computing_min_resource_ratio_threshold = 0.3;
ALTER USER "<role_name>" IN DATABASE <db_name> SET hg_adaptive_serverless_computing_min_cores_threshold = 256;

-- Modify at the DB level
ALTER DATABASE <db_name> SET hg_adaptive_serverless_computing_min_resource_ratio_threshold = 0.3;
ALTER DATABASE <db_name> SET hg_adaptive_serverless_computing_min_cores_threshold = 256;

Adaptive load isolation (Beta)

Usage

The system automatically determines whether to enable adaptive load isolation based on the current load. Enable this feature at the DB level. Run the following command to enable the feature for a DB.

-- Enable adaptive load isolation at the DB level
ALTER DATABASE <db_name> SET hg_adaptive_serverless_computing_enable_load_isolation = on;

Adaptive large task isolation

Usage

Run the following command to enable the adaptive large task isolation feature. Enable this feature at the user or DB level.

  • Before V4.1, you must enable both parameters for the feature to take effect.

  • Starting from V4.1, the hg_enable_adaptive_serverless_computing parameter is deprecated. You only need to enable the hg_adaptive_serverless_computing_enable_big_query_isolation parameter.

-- Enable at the session level
SET hg_enable_adaptive_serverless_computing = on;
SET hg_adaptive_serverless_computing_enable_big_query_isolation = on;

-- Enable at the user level
ALTER USER "<role_name>" IN DATABASE <db_name> SET hg_enable_adaptive_serverless_computing = on;
ALTER USER "<role_name>" IN DATABASE <db_name> SET hg_adaptive_serverless_computing_enable_big_query_isolation = on;

-- Enable at the DB level
ALTER DATABASE <db_name> SET hg_enable_adaptive_serverless_computing = on;
ALTER DATABASE <db_name> SET hg_adaptive_serverless_computing_enable_big_query_isolation = on;

Validation

The application of the adaptive large task isolation feature depends on the system's automatic estimation logic. Hologres provides a resource estimation function to calculate the Required Cores for an SQL statement and check whether the adaptive serverless feature is triggered.

-- Use this if the SQL statement does not contain single quotation marks that need to be escaped.
SELECT * FROM hologres.hg_estimate_adaptive_serverless_computing('select * from tbl;');

-- Use this if the SQL statement contains single quotation marks that need to be escaped.
SELECT * FROM hologres.hg_estimate_adaptive_serverless_computing($$insert into test_tbl_dst_1 select * from test_tbl_src;$$);

The function has the following return values:

Return value name

Description

estimated_cores

The number of Required Cores automatically estimated by the system for the SQL statement.

status

Indicates whether the adaptive serverless feature is applied to the SQL statement based on the current parameter settings, causing it to run on serverless resources.

  • eligible: The statement meets the threshold conditions and will automatically run on serverless resources.

  • ineligible: The statement does not meet the threshold conditions and will run on the instance's own resources.

  • invalid: The statement is not eligible for serverless computing and will run on the instance's own resources.

adaptive_serverless_computing_min_ratio_threshold

The currently configured ratio threshold coefficient.

adaptive_serverless_computing_min_cores_threshold

The currently configured absolute threshold.