All Products
Search
Document Center

:Use the Elastic Parallel Query feature to query data from partitioned tables

Last Updated:Nov 27, 2023

PolarDB for PostgreSQL allows you to use the Elastic Parallel Query feature to query data from partitioned tables to improve the performance of your databases.

Overview

The Elastic Parallel Query 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 Elastic Parallel Query feature for partitioned tables.

  1. By default, the Elastic Parallel Query feature is disabled for partitioned tables. To enable the feature, execute the following statement:

    SET polar_enable_px=on;
  2. To enable the Elastic Parallel Query feature for partitioned tables, execute the following statement:

    SET polar_px_enable_partition = true;
  3. To enable the Elastic Parallel Query feature for multi-level partitioned tables, execute the following statement:

    set  polar_px_optimizer_multilevel_partitioning = true;