现在的位置: 首页 > 综合 > 正文

表分区方法

2013年04月08日 ⁄ 综合 ⁄ 共 4439字 ⁄ 字号 评论关闭

1.每个分区都含有VALUES LESS THAN 语句,用于指定分区的最高边界值(不包含),任何等于或大于该值的分区键都会被添加到下一个高分区。
2.所有的分区(除去第一个分)都含有一个最低边界,这个最低边界为上一个分区的VALUES LESS THAN语句指定的值。
3.MAXVALUE被定义为最高分区。

 

--List分区
使用list分区能够明确的控制行如何映射到分区,需要在分区的描述中指定一个离散(不连续)的值列表。list分区的优势能够使你分组与组织无序非相关的数据集合。 DEFAUL指定一个默认的分区,以至于当行没有映射到任何分区时不会产生错误。

 

--散列分区
Hash partitioning enables easy partitioning of data that does not lend itself to range or list partitioning. It does this with a simple syntax and is easy to implement. It is a better choice than range partitioning when:
    *  You do not know beforehand how much data maps into a given range
    *  The sizes of range partitions would differ quite substantially or would be difficult to balance manually
    *  Range partitioning would cause the data to be undesirably clustered
    *  Performance features such as parallel DML, partition pruning, and partition-wise joins are important

The concepts of splitting, dropping or merging partitions do not apply to hash partitions. Instead, hash partitions can be added and coalesced.  The preceding statement creates a table sales_hash, which is hash partitioned on salesman_id field. The tablespace names are ts1, ts2, ts3, and ts4. With this syntax, we ensure that we create the partitions in a round-robin manner across the specified tablespaces.

--组合分区
组合分区使用range分区方法,在每一个分区里,子分区使用hash或list分区方法。组合range-hash分区提供了range分区的易管理和the data placement, striping, and parallelism advantages of hash partitioning.Composite range-list partitioning provides the manageability of range partitioning and the explicit control of list partitioning for the subpartitions.
Composite partitioning supports historical operations, such as adding new range partitions, but also provides higher degrees of parallelism for DML operations and finer granularity of data placement through subpartitioning.

抱歉!评论已关闭.