Specifying multiple partitioning keys in a RANGE partitioned table v16
You can often improve performance by specifying multiple key columns for a RANGE
partitioned table. If you often select rows using comparison operators on a small set of columns based on a greater-than or less-than value, consider using those columns in RANGE
partitioning rules.
Range-partitioned table definitions can include multiple columns in the partitioning key. To specify multiple partitioning keys for a range-partitioned table, include the column names in a comma-separated list after the PARTITION BY RANGE
clause:
If a table is created with multiple partitioning keys, you must specify multiple key values when querying the table to take full advantage of partition pruning:
Since all rows with a value of 8
in the sale_month
column and a value of 2012
in the sale_year
column are stored in the q3_2012
partition, EDB Postgres Advanced Server searches only that partition.