Configure parallel query

更新时间:
复制 MD 格式

Single-table aggregate queries on large datasets can take seconds or longer. AnalyticDB for PostgreSQL automatically parallelizes these queries across CPU cores, reducing query time by about 50% in low-concurrency scenarios.

How it works

When your instance uses compute nodes with 4 or more cores, parallel query is enabled by default for individual table queries. The system selects the degree of parallelism automatically based on three factors: the number of concurrent queries, the compute node specifications, and the SQL statement being executed. Under high workload, the system disables parallel query to preserve overall throughput.

Parallel query applies to single-table queries only.

Requirements

Parallel query is supported on instances that meet all of the following conditions:

RequirementDetails
Compute node specifications4 cores or higher (4C and above)
Minor engine version6.3.4.0 or later

To update the minor engine version, see Update the minor engine version.

Example

The following example uses an instance with these specifications:

SpecificationValue
Compute node specifications4C32G
Number of compute nodes4
Data volume tested10 GB

Query times for the 10 GB single-table dataset, before and after parallel query:

Before parallel queryAfter parallel query
17456.066 ms9407.291 ms