Database Reference
In-Depth Information
Figure 13-4. Range-hash composite partition example
So, composite partitioning gives you the ability to break your data up by range and, when a given range is
considered too large or further partition elimination could be useful, to break it up further by hash or list. It is
interesting to note that each range partition need not have the same number of subpartitions; for example, suppose
you were range partitioning on a date column in support of data purging (to remove all old data rapidly and easily).
In the year 2013 and before, you had equal amounts of data in odd code numbers in the CODE_KEY_COLUMN and in even
code numbers. But after that, you knew the number of records associated with the odd code number was more than
double, and you wanted to have more subpartitions for the odd code values. You can achieve that rather easily just by
defining more subpartitions:
EODA@ORA12CR1> CREATE TABLE composite_range_list_example
2 ( range_key_column date,
3 code_key_column int,
4 data varchar2(20)
5 )
6 PARTITION BY RANGE (range_key_column)
7 subpartition by list(code_key_column)
8 (
9 PARTITION part_1
10 VALUES LESS THAN(to_date('01/01/2014','dd/mm/yyyy'))
11 (subpartition part_1_sub_1 values( 1, 3, 5, 7 ),
12 subpartition part_1_sub_2 values( 2, 4, 6, 8 )
13 ),
Search WWH ::




Custom Search