Parallel queries EARLY ACCESS
YugabyteDB supports the use of PostgreSQL parallel queries. Using parallel queries, the query planner can devise plans that leverage multiple CPUs to answer queries faster.
Currently, YugabyteDB supports parallel queries for colocated tables; support for hash- and range-sharded tables is planned.
To enable and configure parallel queries, set the following configuration parameters.
Parameter | Description | Default |
---|---|---|
yb_enable_parallel_append | Enables the planner's use of parallel append plans. To enable parallel query, set this to true. | false |
yb_parallel_range_rows | The number of rows to plan per parallel worker. To enable parallel query, set this to a value other than 0. (Recommended: 10000) | 0 |
yb_parallel_range_size | Approximate size of parallel range for DocDB relation scans. | 1MB |
In addition, you can use the following PostgreSQL configuration parameters to configure parallel queries:
- Optimize the number of workers used by the parallel query.
- Optimize cost of parallel plan to achieve the optimal plan.
- Enable or disable the query planner's use of hash-join plan types with parallel hash. Has no effect if hash-join plans are not also enabled. The default is on.
For more information, refer to How Parallel Query Works in the PostgreSQL documentation.