Parallel operations

Updated at:

GanosBase uses multiple CPU cores to speed up query execution and user-defined function (UDF) computations. This mechanism is called parallel operation. GanosBase supports parallel executions of SQL statements and parallel operations on UDFs. You can control how many cores are used and how transactions behave during parallel execution.

How it works

SQL statements

In a multi-CPU core environment, GanosBase uses multiple CPU cores to generate parallel query plans. Then, GanosBase distributes the query plans to different CPU cores. Queries on database objects are automatically split into subsets and assigned to different CPU cores. The cores process their subsets independently, which increases overall query performance.

UDFs

For time-consuming UDF operations, GanosBase splits a single UDF's computation into subsets and runs each subset on a separate CPU core in parallel. Each subset is computed independently. This reduces the time required for the overall computation of the UDF. The overall UDF computation completes when all subsets finish.

Configure the degree of parallelism

The degree of parallelism (DOP) controls how many CPU cores GanosBase uses for a parallel operation.

Each function that supports parallel operations accepts a DOP parameter. Set it to a positive integer to split the computation of a raster object into parallel tasks that can be independently run.

If you do not specify a DOP, or set it to 0, GanosBase uses the value of the ganos.parallel.degree Grand Unified Configuration (GUC) parameter. The default value is 1, which means parallel executions or operations are not supported.

DOP valueBehavior
1 (default)Parallel executions or operations not supported
0Falls back to ganos.parallel.degree
Positive integerSplits computation of a raster object into that many independently runnable parallel tasks

Configure transaction consistency

Use the ganos.parallel.transaction GUC parameter to set the transaction consistency level for parallel operations.

ValueBehavior
transaction_commit (default)Parallel transactions are committed or rolled back based on the primary transaction
fast_commitParallel transactions cannot be rolled back

Limitations

Create all required tables before running parallel operations. Tables cannot be created while a parallel operation is in progress.