PolarDB for PostgreSQL allows you to use the cross-node parallel execution feature to query data from partitioned tables to improve the performance of your databases.

Overview

The cross-node parallel execution feature allows you to perform the following operations:

  • Query data from range partitions in parallel.
  • Query data from list partitions in parallel.
  • Query data from hash partitions in parallel.
  • Prune partitions.
  • Query data from partitioned tables that have indexes in parallel.
  • Use JOIN to query data from partitioned tables.
  • This feature cannot be used to query data from multi-level partitions.

Limits

This feature cannot be used to query data from hash partitions in which data is partitioned by more than one column.

Usage

Enable the cross-node parallel execution feature for partitioned tables.

  1. By default, the cross-node parallel execution feature is disabled for partitioned tables. To enable the feature, execute the following statement:
    SET polar_enable_px=on;
  2. To enable the cross-node parallel execution feature for partitioned tables, execute the following statement:
    SET polar_px_enable_partition = true;
  3. To enable the cross-node parallel execution feature for multi-level partitioned tables, execute the following statement:
    set  polar_px_optimizer_multilevel_partitioning = true;