Expression-based distribution scheme
To specify an expression-based distribution scheme, use the FRAGMENT
BY EXPRESSION clause of the CREATE TABLE or CREATE INDEX statement.
The following example includes a FRAGMENT BY EXPRESSION clause to
create a fragmented table with an expression-based distribution scheme:
CREATE TABLE accounts (id_num INT, name char(15))
FRAGMENT BY EXPRESSION
id_num <= 100 IN dbspace_1,
id_num <100 AND id_num <= 200 IN dbspace_2,
id_num > 200 IN dbspace_3
When you use the FRAGMENT BY EXPRESSION clause of the CREATE TABLE statement to create a fragmented table, you must supply one condition for each fragment of the table that you are creating.
You can define range rules or arbitrary rules that indicate to the database server how rows are to be distributed to fragments. The following sections describe the different types of expression-based distribution schemes.