Partition Clause

Specifies partitioning of table data, through a PARTITION BY clause in the table definition:

PARTITION BY partition‑expression [ GROUP BY group‑expression ]
PARTITION BY partition‑expression

For each table row, resolves to a partition key that is derived from one or more table columns.

Caution: Avoid partitioning tables on LONG VARBINARY and LONG VARCHAR columns. Doing so can adversely impact performance.

GROUP BY group‑expression

For each table row, resolves to a partition group key that is derived from the partition key. Vertica uses group keys to merge partitions into separate partition groups. GROUP BY must use the same expression as PARTITION BY. For example:

CASE WHEN (i+j) < 5 THEN 1 WHEN (i+j) < 10 THEN 2 ELSE 3);

For details on partitioning table data by groups, see Partition Grouping and Hierarchical Partitioning in the Administrator's Guide.

Partitioning Requirements and Restrictions

PARTITION BY expressions can specify leaf expressions, functions, and operators. The following requirements and restrictions apply:

GROUP BY expressions do not support modulo (%) operations.

See Also

Partitioning Tables in the Administrator's Guide