Oracle Database Hash partitioning


Example

This creates a table partitioned by hash, in this example on store id.

CREATE TABLE orders (
    order_nr NUMBER(15),
    user_id VARCHAR2(2),
    order_value NUMBER(15),
    store_id NUMBER(5)
) 
PARTITION BY HASH(store_id) PARTITIONS 8;

You should use a power of 2 for the number of hash partitions, so that you get an even distribution in partition size.