Query Queue routes incoming SQL requests to separate queues based on configurable classifier rules. Each queue enforces its own concurrency limit and queue size, so high-concurrency workloads stay stable without one query type monopolizing resources.
Query Queue is available in Hologres V3.0 and later for General-purpose and Virtual Warehouse instances.
How it works
By default, every request submitted to a Hologres instance runs immediately—the Coordinator assigns resources and executes queries without any concurrency controls.
When Query Queue is enabled, each incoming SQL request is matched against classifier rules in priority order. The first matching classifier routes the request to the corresponding queue. If no classifier matches, the request falls through to default_queue. Each queue then enforces its own max_concurrency and max_queue_size limits: once a queue is full, new requests wait until compute resources become available.
Routing order for classifiers:
| Step | Rule |
|---|---|
| 1 | Classifiers are evaluated by priority (highest value first). |
| 2 | If two classifiers share the same priority, they are matched in lexicographical order of the queue name and classifier name—for example, queue_a/classifier_1 is matched before queue_b/classifier_1. |
| 3 | Requests that match no classifier are sent to default_queue. |
Usage notes
-
Query Queue and optimizer settings apply at the instance level for General-purpose instances and at the compute group level for Virtual Warehouse instances. If an instance contains multiple databases, all databases share these settings.
-
Only General-purpose and Virtual Warehouse instances running Hologres V3.0 and later support Query Queue. To upgrade an earlier instance, see Instance upgrades or contact support via the Hologres DingTalk group. For details, see How do I get more online support?.
-
Each General-purpose instance and each compute group in a Virtual Warehouse instance has a built-in queue named
default_queue. This queue has no concurrency or size limits and accepts all requests that do not match any other queue. It does not support classifiers, but you can configure its other properties. -
Each instance or compute group supports up to 10 query queues (including
default_queue), and each queue supports up to 10 classifiers. -
Read-only replica instances cannot have Query Queue enabled independently. They inherit the query queue rules from the primary instance.
-
Only queries with engine types HQE, PQE, SQE, or HiveQE are matched to query queues. Supported statement types: SELECT, INSERT, UPDATE, DELETE, and INSERT statements generated by COPY or CTAS commands.
-
Queries that use Fixed Plan bypass query queues entirely.
-
A classifier belongs to exactly one queue, but one queue can have multiple classifiers.
-
In V3.0.10 and later, you can configure a queue to run all its queries using Serverless Computing resources. Those queries are not subject to the queue's concurrency limits or queuing mechanisms.
Prerequisites
Before you begin, ensure that you have:
-
A Hologres V3.0 or later instance (General-purpose or Virtual Warehouse)
-
Permissions to call stored procedures on the instance
Create a query queue
Use hg_create_query_queue to create a queue. You can set max_concurrency and max_queue_size at creation time; configure other properties afterward with hg_set_query_queue_property.
General-purpose instance:
CALL hg_create_query_queue (query_queue_name, max_concurrency, max_queue_size);
Virtual Warehouse instance:
CALL hg_create_query_queue (warehouse_name, query_queue_name, max_concurrency, max_queue_size);
Parameters:
| Parameter | Required | Description |
|---|---|---|
warehouse_name |
Virtual Warehouse only | The compute group name. Defaults to the currently connected compute group. |
query_queue_name |
Yes | The queue name. Must be unique within the instance or compute group. |
max_concurrency |
No | Maximum concurrent queries. Default: -1 (no limit). Range: [-1, 2147483647). |
max_queue_size |
No | Maximum queued queries. Default: -1 (no limit). Range: [-1, 2147483647). |
Examples:
-- General-purpose: create insert_queue with max concurrency 10
-- Do not quote numeric values
CALL hg_create_query_queue ('insert_queue', 10);
-- Virtual Warehouse: create insert_queue in the init_warehouse compute group
CALL hg_create_query_queue ('init_warehouse', 'insert_queue', 10);
Create a classifier
Use hg_create_classifier to create a classifier and attach it to a queue. Set matching rules separately with hg_set_classifier_rule_condition_value.
General-purpose instance:
CALL hg_create_classifier (query_queue_name, classifier_name, priority);
Virtual Warehouse instance:
CALL hg_create_classifier (warehouse_name, query_queue_name, classifier_name, priority);
Parameters:
| Parameter | Required | Description |
|---|---|---|
warehouse_name |
Virtual Warehouse only | The compute group name. Defaults to the currently connected compute group. |
query_queue_name |
Yes | The queue this classifier belongs to. |
classifier_name |
Yes | The classifier name. Must be unique within the instance or compute group. |
priority |
No | Matching priority. Higher value = higher priority. Default: 50. Range: [1, 100]. |
Examples:
-- General-purpose: create classifier_insert in insert_queue with priority 20
-- Do not quote numeric values
CALL hg_create_classifier ('insert_queue', 'classifier_insert', 20);
-- Virtual Warehouse: create classifier_insert in init_warehouse's insert_queue
CALL hg_create_classifier ('init_warehouse', 'insert_queue', 'classifier_insert', 20);
Configure classifier matching rules
Use hg_set_classifier_rule_condition_value to add matching conditions to a classifier. Call it once per condition value—to match multiple values for the same attribute, call it multiple times.
General-purpose instance:
CALL hg_set_classifier_rule_condition_value (query_queue_name, classifier_name, condition_name, condition_value);
Virtual Warehouse instance:
CALL hg_set_classifier_rule_condition_value (warehouse_name, query_queue_name, classifier_name, condition_name, condition_value);
Parameters:
| Parameter | Required | Description |
|---|---|---|
warehouse_name |
Virtual Warehouse only | The compute group name. Defaults to the currently connected compute group. |
query_queue_name |
Yes | The queue name. |
classifier_name |
Yes | The classifier to configure. |
condition_name |
Yes | The condition attribute. See the table below. |
condition_value |
Yes | The value to match. Enclose case-sensitive values in double quotation marks (""). |
Supported condition attributes:
| Attribute | Description | Version |
|---|---|---|
user_name |
The UID of the submitting account. | V3.0+ |
command_tag |
The statement type: INSERT, SELECT, UPDATE, DELETE. Limiting INSERT also limits COPY write concurrency. |
V3.0+ |
db_name |
The database name. | V3.0+ |
digest |
The SQL fingerprint. See SQL fingerprint. | V3.0+ |
application_name |
The application that submitted the query. | V3.0.9+ |
engine_type |
The query engine: HQE, PQE, SQE, HiveQE. |
V3.1.18+ (recommended) |
storage_mode |
The storage access mode: hot, cold. |
V3.1.8+ or V3.1.18+ |
write_table |
The table written by the query. Format: <db_name>.<schema_name>.<table_name>. |
V3.1+ |
read_table |
The table read by the query. | V3.1+ |
Matching logic (V3.1.18 and later):
Multiple attributes in one classifier use AND logic. To express OR logic between attributes, create multiple classifiers pointing to the same queue.
Within a single attribute, matching behavior depends on the attribute type:
| Attribute type | Match rule |
|---|---|
user_name, command_tag, db_name, digest, application_name |
Matches if the query's attribute value is in the configured set. |
storage_mode |
Requires exact set equality—both configured and query sets must match. |
engine_type, write_table, read_table |
Matches if the query's set and the configured set have any overlap. |
Examples:
The following examples use the init_warehouse compute group. For General-purpose instances, omit the first argument.
Example 1: Route queries by user OR SQL fingerprint to the same queue.
CALL hg_create_query_queue ('init_warehouse', 'test_queue');
-- Classifier for user-based routing
CALL hg_create_classifier ('init_warehouse', 'test_queue', 'classifier_user');
CALL hg_set_classifier_rule_condition_value ('init_warehouse', 'test_queue', 'classifier_user', 'user_name', 'p4_123');
CALL hg_set_classifier_rule_condition_value ('init_warehouse', 'test_queue', 'classifier_user', 'user_name', 'p4_456');
-- Classifier for digest-based routing (OR relationship = separate classifier on same queue)
CALL hg_create_classifier ('init_warehouse', 'test_queue', 'classifier_digest');
CALL hg_set_classifier_rule_condition_value ('init_warehouse', 'test_queue', 'classifier_digest', 'digest', 'xxx');
CALL hg_set_classifier_rule_condition_value ('init_warehouse', 'test_queue', 'classifier_digest', 'digest', 'yyy');
Example 2: Route queries from a specific application that access both hot and cold storage (AND logic).
CALL hg_create_classifier ('init_warehouse', 'test_queue', 'classifier_3');
CALL hg_set_classifier_rule_condition_value ('init_warehouse', 'test_queue', 'classifier_3', 'application_name', 'xx_bi');
-- Setting both hot and cold means the query must access both storage types
CALL hg_set_classifier_rule_condition_value ('init_warehouse', 'test_queue', 'classifier_3', 'storage_mode', 'hot');
CALL hg_set_classifier_rule_condition_value ('init_warehouse', 'test_queue', 'classifier_3', 'storage_mode', 'cold');
Example 3: Route all queries that access cold storage (requires two classifiers because storage_mode uses exact matching).
-- Queries accessing only cold storage
CALL hg_create_classifier ('init_warehouse', 'test_queue', 'classifier_cold_1');
CALL hg_set_classifier_rule_condition_value ('init_warehouse', 'test_queue', 'classifier_cold_1', 'storage_mode', 'cold');
-- Queries accessing both hot and cold storage
CALL hg_create_classifier ('init_warehouse', 'test_queue', 'classifier_cold_2');
CALL hg_set_classifier_rule_condition_value ('init_warehouse', 'test_queue', 'classifier_cold_2', 'storage_mode', 'hot');
CALL hg_set_classifier_rule_condition_value ('init_warehouse', 'test_queue', 'classifier_cold_2', 'storage_mode', 'cold');
Example 4: Route queries that read from table `a` AND write to table `b`.
CALL hg_create_classifier ('init_warehouse', 'test_queue', 'classifier_table');
CALL hg_set_classifier_rule_condition_value ('init_warehouse', 'test_queue', 'classifier_table', 'read_table', 'db_name.schema_name.a');
CALL hg_set_classifier_rule_condition_value ('init_warehouse', 'test_queue', 'classifier_table', 'write_table', 'db_name.schema_name.b');
More operations
Manage query queue properties
Use hg_set_query_queue_property to configure a queue after creation.
General-purpose instance:
CALL hg_set_query_queue_property (query_queue_name, property_key, property_value);
Virtual Warehouse instance:
CALL hg_set_query_queue_property (warehouse_name, query_queue_name, property_key, property_value);
Supported properties:
| Property | Description | Default | Range |
|---|---|---|---|
max_concurrency |
Maximum concurrent queries. | -1 (no limit) |
[-1, 2147483647) |
max_queue_size |
Maximum queued queries. | -1 (no limit) |
[-1, 2147483647) |
queue_timeout_ms |
Maximum wait time in the queue (ms). Queries exceeding this limit are terminated. | -1 (no limit) |
[-1, 2147483647) |
Examples:
-- General-purpose
CALL hg_set_query_queue_property ('insert_queue', 'max_concurrency', '15');
CALL hg_set_query_queue_property ('insert_queue', 'max_queue_size', '15');
CALL hg_set_query_queue_property ('insert_queue', 'queue_timeout_ms', '3000');
-- Virtual Warehouse
CALL hg_set_query_queue_property ('init_warehouse', 'insert_queue', 'max_concurrency', '15');
CALL hg_set_query_queue_property ('init_warehouse', 'insert_queue', 'max_queue_size', '15');
CALL hg_set_query_queue_property ('init_warehouse', 'insert_queue', 'queue_timeout_ms', '3000');
Delete a queue property
To reset a property to its default, use hg_remove_query_queue_property. Valid values for property_key: max_concurrency, max_queue_size, queue_timeout_ms.
-- General-purpose
CALL hg_remove_query_queue_property ('insert_queue', 'max_concurrency');
CALL hg_remove_query_queue_property ('insert_queue', 'max_queue_size');
CALL hg_remove_query_queue_property ('insert_queue', 'queue_timeout_ms');
-- Virtual Warehouse
CALL hg_remove_query_queue_property ('init_warehouse', 'insert_queue', 'max_concurrency');
CALL hg_remove_query_queue_property ('init_warehouse', 'insert_queue', 'max_queue_size');
CALL hg_remove_query_queue_property ('init_warehouse', 'insert_queue', 'queue_timeout_ms');
Clear queued requests
To flush all waiting requests from a queue without deleting it, use hg_clear_query_queue.
-- General-purpose
CALL hg_clear_query_queue ('select_queue');
-- Virtual Warehouse
CALL hg_clear_query_queue ('init_warehouse', 'select_queue');
Delete a query queue
Use hg_drop_query_queue to delete a queue.
-- General-purpose
CALL hg_drop_query_queue ('insert_queue');
-- Virtual Warehouse
CALL hg_drop_query_queue ('init_warehouse', 'insert_queue');
View query queue metadata
Queue configuration is stored in the hologres.hg_query_queues system table.
| Field | Type | Description |
|---|---|---|
warehouse_id |
INT | Compute group ID. 0 for General-purpose instances. |
warehouse_name |
TEXT | Compute group name. Empty for General-purpose instances. |
query_queue_name |
TEXT | Queue name. |
property_key |
TEXT | Property name. |
property_value |
TEXT | Property value. |
Manage classifier properties
Configure classifier priority
Use hg_set_classifier_property to update a classifier's priority after creation.
-- General-purpose
CALL hg_set_classifier_property ('insert_queue', 'classifier_insert', 'priority', '30');
-- Virtual Warehouse
CALL hg_set_classifier_property ('init_warehouse', 'insert_queue', 'classifier_insert', 'priority', '30');
The priority property accepts values in the range [1, 100]. A larger value means higher priority. When two classifiers share the same priority, the one with the lexicographically earlier queue name and classifier name is matched first.
Delete classifier properties
Use hg_remove_classifier_property to reset a classifier property. The only supported property_key is priority.
-- General-purpose
CALL hg_remove_classifier_property ('insert_queue', 'classifier_insert', 'priority');
-- Virtual Warehouse
CALL hg_remove_classifier_property ('init_warehouse', 'insert_queue', 'classifier_insert', 'priority');
Delete classifier matching rules
Delete a specific condition value:
-- General-purpose
CALL hg_remove_classifier_rule_condition_value ('insert_queue', 'classifier_insert', 'command_tag', 'INSERT');
CALL hg_remove_classifier_rule_condition_value ('insert_queue', 'classifier_insert', 'user_name', 'p4_12345');
CALL hg_remove_classifier_rule_condition_value ('insert_queue', 'classifier_insert', 'db_name', 'prd_db');
CALL hg_remove_classifier_rule_condition_value ('insert_queue', 'classifier_insert', 'engine_type', 'HQE');
CALL hg_remove_classifier_rule_condition_value ('insert_queue', 'classifier_insert', 'digest', 'md5edb3161000a003799a5d3f2656b70b4c');
CALL hg_remove_classifier_rule_condition_value ('insert_queue', 'classifier_insert', 'storage_mode', 'hot');
-- Virtual Warehouse
CALL hg_remove_classifier_rule_condition_value ('init_warehouse', 'insert_queue', 'classifier_insert', 'command_tag', 'INSERT');
CALL hg_remove_classifier_rule_condition_value ('init_warehouse', 'insert_queue', 'classifier_insert', 'user_name', 'p4_12345');
CALL hg_remove_classifier_rule_condition_value ('init_warehouse', 'insert_queue', 'classifier_insert', 'db_name', 'prd_db');
CALL hg_remove_classifier_rule_condition_value ('init_warehouse', 'insert_queue', 'classifier_insert', 'engine_type', 'HQE');
CALL hg_remove_classifier_rule_condition_value ('init_warehouse', 'insert_queue', 'classifier_insert', 'digest', 'md5edb3161000a003799a5d3f2656b70b4c');
CALL hg_remove_classifier_rule_condition_value ('init_warehouse', 'insert_queue', 'classifier_insert', 'storage_mode', 'hot');
Delete all values for a condition attribute:
-- General-purpose
CALL hg_remove_classifier_rule_condition ('insert_queue', 'classifier_insert', 'command_tag');
CALL hg_remove_classifier_rule_condition ('insert_queue', 'classifier_insert', 'user_name');
CALL hg_remove_classifier_rule_condition ('insert_queue', 'classifier_insert', 'db_name');
CALL hg_remove_classifier_rule_condition ('insert_queue', 'classifier_insert', 'engine_type');
CALL hg_remove_classifier_rule_condition ('insert_queue', 'classifier_insert', 'digest');
CALL hg_remove_classifier_rule_condition ('insert_queue', 'classifier_insert', 'storage_mode');
-- Virtual Warehouse
CALL hg_remove_classifier_rule_condition ('init_warehouse', 'insert_queue', 'classifier_insert', 'command_tag');
CALL hg_remove_classifier_rule_condition ('init_warehouse', 'insert_queue', 'classifier_insert', 'user_name');
CALL hg_remove_classifier_rule_condition ('init_warehouse', 'insert_queue', 'classifier_insert', 'db_name');
CALL hg_remove_classifier_rule_condition ('init_warehouse', 'insert_queue', 'classifier_insert', 'engine_type');
CALL hg_remove_classifier_rule_condition ('init_warehouse', 'insert_queue', 'classifier_insert', 'digest');
CALL hg_remove_classifier_rule_condition ('init_warehouse', 'insert_queue', 'classifier_insert', 'storage_mode');
Delete a classifier
Use hg_drop_classifier to delete a classifier.
-- General-purpose
CALL hg_drop_classifier ('insert_queue', 'classifier_insert');
-- Virtual Warehouse
CALL hg_drop_classifier ('init_warehouse', 'insert_queue', 'classifier_insert');
View classifier metadata
Classifier configuration is stored in the hologres.hg_classifiers system table.
| Field | Type | Description |
|---|---|---|
warehouse_id |
INT | Compute group ID. 0 for General-purpose instances. |
warehouse_name |
TEXT | Compute group name. Empty for General-purpose instances. |
query_queue_name |
TEXT | The queue the classifier belongs to. |
classifier_name |
TEXT | Classifier name. |
property_key |
TEXT | Property name. |
property_value |
TEXT | Property value. |
Control large query execution
Query Queue can terminate or reroute queries that exceed execution time or memory thresholds. This protects other workloads from being blocked by resource-intensive queries.
These controls apply only to the get_next_cost phase (query execution). Queue wait time and lock wait time are not counted. In V3.0, only SELECT queries can be rerun; FETCH-based queries are rerun only if the FETCH returns no data.
Execution time control:
Set big_query_execution_time_threshold_sec (unit: seconds, default: -1, range: [-1, 2147483647)) to terminate or reroute slow queries.
-- Terminate queries that run longer than 10 seconds
CALL hg_set_query_queue_property ('select_queue', 'big_query_execution_time_threshold_sec', '10');
-- Reroute queries that run longer than 10 seconds to Serverless Computing
CALL hg_set_query_queue_property ('select_queue', 'big_query_execution_time_threshold_sec', '10');
CALL hg_set_query_queue_property ('select_queue', 'enable_rerun_as_big_query_when_exceeded_execution_time_threshold', 'true');
CALL hg_set_query_queue_property ('select_queue', 'rerun_big_query_on_computing_resource', 'serverless');
OOM-triggered rerouting:
Set big_query_mem_threshold_when_oom_gb (unit: GB, default: -1, range: [-1, 64)) to reroute queries that trigger an out-of-memory (OOM) error on a single worker node.
-- Reroute to Serverless Computing if a query triggers OOM and uses more than 10 GB on one worker
CALL hg_set_query_queue_property ('select_queue', 'big_query_mem_threshold_when_oom_gb', '10');
CALL hg_set_query_queue_property ('select_queue', 'enable_rerun_as_big_query_when_oom_exceeded_mem_threshold', 'true');
CALL hg_set_query_queue_property ('select_queue', 'rerun_big_query_on_computing_resource', 'serverless');
Choosing between time-based and OOM-based thresholds:
| Use case | Recommended threshold |
|---|---|
| Prevent long-running analytical queries from blocking OLTP workloads | big_query_execution_time_threshold_sec |
| Prevent memory pressure from cascading across worker nodes | big_query_mem_threshold_when_oom_gb |
Route a queue to Serverless Computing
Available in V3.0.10 and later. Configure a queue to run all its queries on Serverless Computing resources instead of local compute. Queries in this queue bypass the queue's concurrency limits and are scheduled by submission order and priority.
If Serverless Computing is unavailable in the zone where the instance resides, queries fall back to local compute resources.
For more information, see Serverless Computing user guide.
General-purpose instance:
-- Route all queries in the queue to Serverless Computing
CALL hg_set_query_queue_property ('insert_queue', 'computing_resource', 'serverless');
-- (Optional) Set priority for Serverless queries. Default: 3. Range: [1, 5].
CALL hg_set_query_queue_property ('insert_queue', 'query_priority_when_using_serverless_computing', '2');
Virtual Warehouse instance:
CALL hg_set_query_queue_property ('init_warehouse', 'insert_queue', 'computing_resource', 'serverless');
CALL hg_set_query_queue_property ('init_warehouse', 'insert_queue', 'query_priority_when_using_serverless_computing', '2');
Common scenarios
Each scenario below includes all required statements in a single block—copy and run them together.
Isolate INSERT workloads
Route all INSERT requests to a dedicated queue with concurrency 10 and max queue size 20. All INSERT SQL goes to insert_queue via classifier_1.
-- Create the queue
CALL hg_create_query_queue ('insert_queue', 10, 20);
-- Create a classifier for INSERT statements
CALL hg_create_classifier ('insert_queue', 'classifier_1');
CALL hg_set_classifier_rule_condition_value ('insert_queue', 'classifier_1', 'command_tag', 'INSERT');
Limit concurrency for specific users
Restrict users p4_123 and p4_345 to 3 concurrent queries. Their requests are matched by classifier_2 and routed to user_queue.
-- Create the queue with concurrency 3 and no queue size limit
CALL hg_create_query_queue ('user_queue', 3);
CALL hg_set_query_queue_property ('user_queue', 'max_queue_size', '-1');
-- Create a classifier for user-based routing
CALL hg_create_classifier ('user_queue', 'classifier_2');
CALL hg_set_classifier_rule_condition_value ('user_queue', 'classifier_2', 'user_name', 'p4_123');
CALL hg_set_classifier_rule_condition_value ('user_queue', 'classifier_2', 'user_name', 'p4_345');
For RAM users or custom accounts, enclose the account name in double quotation marks. Example: CALL hg_set_classifier_rule_condition_value ('user_queue', 'classifier_2', 'user_name', '"BASIC$xxx"');
Isolate queries by database
Route queries for the test and postgres databases to db_queue, with concurrency 5 and a 10-minute queue timeout.
-- Create the queue
CALL hg_create_query_queue ('db_queue', 5);
CALL hg_set_query_queue_property ('db_queue', 'queue_timeout_ms', '600000');
-- Create a classifier for database-based routing
CALL hg_create_classifier ('db_queue', 'classifier_3');
CALL hg_set_classifier_rule_condition_value ('db_queue', 'classifier_3', 'db_name', 'test');
CALL hg_set_classifier_rule_condition_value ('db_queue', 'classifier_3', 'db_name', 'postgres');
Isolate HQE engine queries
Route queries processed by the HQE engine to hqe_queue, with concurrency 10.
-- Create the queue
CALL hg_create_query_queue ('hqe_queue', 10);
-- Create a classifier for engine-type routing
CALL hg_create_classifier ('hqe_queue', 'classifier_4');
CALL hg_set_classifier_rule_condition_value ('hqe_queue', 'classifier_4', 'engine_type', 'HQE');
Block all traffic to a queue (emergency stop)
Set both concurrency and queue size to 0 to immediately reject all incoming requests:
CALL hg_set_query_queue_property ('insert_queue', 'max_concurrency', '0');
CALL hg_set_query_queue_property ('insert_queue', 'max_queue_size', '0');
Monitor query queues
Check which queue a query is assigned to
Run EXPLAIN or EXPLAIN ANALYZE to see the assigned queue before or after execution. The Query Queue field in the output shows the matched queue and classifier.
-- Set up a sample queue and classifier
CALL hg_create_query_queue ('select_queue', 10, 20);
CALL hg_create_classifier ('select_queue', 'classifier_1');
CALL hg_set_classifier_rule_condition_value ('select_queue', 'classifier_1', 'command_tag', 'select');
-- Run EXPLAIN ANALYZE to see the matched classifier and queue
EXPLAIN ANALYZE SELECT * FROM hg_stat_activity;
The output includes a Query Queue line at the end:
QUERY PLAN
Gather (cost=0.00..14.96 rows=1000 width=408)
...
Query id:[1001002491453065719]
Query Queue: init_warehouse.select_queue.classifier_1
View active queries and their queue status
Run the following query to see the queue name, stage, and wait time for all active queries:
SELECT
running_info::json -> 'current_stage' ->> 'stage_name' AS stage_name,
running_info::json -> 'current_stage' ->> 'queue_time_ms' AS queue_time_ms,
running_info::json ->> 'query_queue' AS query_queue,
*
FROM
hg_stat_activity;
Search query history by queue
Use the hologres.hg_query_log system table to retrieve historical queries and their queue assignment. For more information, see View the query_log table.
-- For Virtual Warehouse instances (include warehouse_name)
SELECT * FROM hologres.hg_query_log WHERE query_detail LIKE '%query_queue = <warehouse_name>.<queue_name>%';
-- For General-purpose instances (omit warehouse_name)
SELECT * FROM hologres.hg_query_log WHERE query_detail LIKE '%query_queue = <queue_name>%';
The extended_info field includes Serverless Computing source information:
| Value | Description |
|---|---|
user_submit |
The query was explicitly submitted to run on Serverless Computing, independent of Query Queue. |
query_queue |
The query ran on Serverless Computing because its queue is configured to use Serverless resources. |
query_queue_rerun |
The query was automatically rerouted to Serverless Computing by the large query control feature. |
When serverless_computing_source is query_queue_rerun, the query_id_of_triggered_rerun field contains the original query ID.