Ganos uses multiple CPUs to increase the performance of queries or computing. This feature is called parallel operation. Ganos supports parallel SQL statements and parallel raster-level operations.

Execute SQL statements in parallel

  • How it works

    PostgreSQL uses multiple CPUs to generate multiple query plans in parallel. Then, PostgreSQL balances the new query plans across these CPUs. This increases the query performance.

  • Scenario

    If you want to scan a large number of raster objects to identify those that meet the specified spatial scope or attribute requirements, we recommend that you execute parallel SQL statements. This significantly reduces the time that is required to run queries.

  • Scope

    All the read-only functions that are used to compute raster objects in Ganos support parallel queries. These functions include the function that is used to query the attributes of a raster object.

Manage raster objects in parallel

  • How it works

    In most cases, Ganos uses multiple CPUs to perform multiple operations in parallel on the subsets of a raster object. This reduces the time that is required for the overall computation on the raster object. Each subset is independently computed. When the computations on all the subsets are complete, the parallel operations on the raster object end.

  • Scenario

    The raster object that you want to compute is large. In this case, a long period of time is required to complete the overall computation.

  • Scope

    For more information about the functions that support parallel raster-level operations, see the following topics:

Before you start

  • Set the maximum number of transactions that can be used in the prepared state.

    You can use the max_prepared_transactions parameter to set the maximum number. The default value of this parameter is 0. We recommend that you set this parameter to the value of the max_connections parameter. This ensures that one transaction in the Prepared state is assigned to each connection.

    Note After you reconfigure this parameter, you must restart your instance.
  • Set the degree of parallelism

    Before you invoke a function that supports parallel raster-level operations, you must set the degree of parallelism. By default, the value of a Grand Unified Configuration (GUC) parameter is used as the degree of parallelism. This applies if you do not specify the degree of parallelism or set it to 0. The GUC parameter is set to The default value of the is 1. The value 1 indicates that the function does not support parallel raster-level operations.

    You can also set this parameter to a positive integer for a function that supports parallel raster-level operations. Then, you can split the computation on a raster object into parallel tasks. Example:

    select ST_ImportFrom('chunk_table','OSS://<akxxxx>:<ak_secretxxxx>', '{}', '{"parallel": 4}');
  • Set the transactional consistency

    You can specify the transactional consistency by using the ganos.parallel.transaction GUC parameter. Valid values:

    • transaction_commit specifies that Ganos can commit or roll back parallel transactions based on the main transaction. This is the default value.
    • fast_commit: specifies that Ganos cannot commit or roll back parallel transactions based on the main transaction.
  • To ensure the optimal performance, you can use the ST_CreateChunkTable function to create a chunk table in advance.
  • If a parallel function cannot return a temporary chunk table that is created by an anonymous user, you must first create a chunk table. Then, specify the chunk table in the chunktable parameter.