Book Contents

Book Index

Next Topic

Home

Hash Segmentation

Hash segmentation is the preferred method of segmentation in Vertica 2.0 and later. Refer to the CREATE PROJECTION command in the SQL Reference Manual for detailed information about using hash segmentation in a projection.

Hash segmentation allows you to segment a projection based on a built-in hash function that provides even distribution of data across some or all of the nodes in a cluster, resulting in optimal query execution. To use hash segmentation, simply choose one or more column values to use as input parameters to the built-in Hash Function (see HASH in the SQL Reference Manual for more information).

Hash segmentation's ALL NODES ... OFFSET syntax provides an easy way to create the buddy projections that form part of a K-Safe design. For example:

CREATE PROJECTION ... SEGMENTED BY HASH(C1,C2,...) ALL NODES;

CREATE PROJECTION ... SEGMENTED BY HASH(C1,C2,...) ALL NODES OFFSET 1;

produces two hash-segmented buddy projections. The projections can use different sort orders.