This feature uses the GiST Sort method to parallelize the index creation process, which significantly reduces the read/write operations on disks and accelerates index creation.

Precautions

The GiST Sort method is only applicable to points. Using this method for other types of spatial data will affect the query performance of indexes.

Usage

Note The number of workers and the total memory usage of workers in the following statements are provided for reference. You can configure them as needed.
  1. Enable the GiST Sort feature.
    set polar_enable_gist_sort=on;
  2. Configure the number of parallel workers.

    The more parallel workers that you use to scan data tables, the higher the CPU load is during query. Therefore, we recommend that the number of workers you set do not exceed the number of physical CPU cores.

    set max_parallel_maintenance_workers=4;
  3. Configure the total memory usage of parallel workers. This parameter is recommended to be at least 1G.
    set maintenance_work_mem='1GB';
  4. Create a GiST index.
    create index on t using gist(geom);
  5. Execute the following statement to disable the Gist Sort feature:
    set polar_enable_gist_sort=off;