ITPub博客

首页 > Linux操作系统 > Linux操作系统 > NOTES on concepts ---Partitions

NOTES on concepts ---Partitions

原创 Linux操作系统 作者:cheng194421 时间:2012-12-03 14:02:09 0 删除 编辑
Each partition is an independent object with its own name and optionally its own storage characteristics.

Benefits include:
  • Increased availability: The query optimizer automatically removes unreferenced partitions from the query plan.
  • Easier administration of schema objects: A partitioned object has pieces that can be managed either collectively or individually.
  • Reduced contention for shared resources in OLTP systems.
  • Enhanced query performance in data warehouses

Partition Characteristics
Each partition of a table or index must have the same logical attributes, such as column names, data types, and constraints.However, each partition can have separate physical attributes, such as the tablespace to which it belongs.

    Partition Key
A set of one or more columns that determines the partition in which each row in a partitioned table should go.

    Partitioning Strategies
  1. Range Partitioning: The database maps rows to partitions based on ranges of values of the partitioning key.
  2. List Partitioning: The database uses a list of discrete values as the partition key for each partition.
  3. Hash Partitioning: The database maps rows to partitions based on a hashing algorithm that the database applies to the user-specified partitioning key.
     For example:
1) CREATE TABLE time_range_sales (prod_id NUMBER(6)
, cust_id NUMBER
, time_id DATE
.......)
PARTITION BY RANGE (time_id)
  ( ......    );

2) CREATE TABLE list_sales ( prod_id NUMBER(6)
, cust_id NUMBER
, time_id DATE
, channel_id CHAR(1)
......   )
     PARTITION BY LIST (channel_id)
( ...... );

3) CREATE TABLE hash_sales ( prod_id NUMBER(6)
, cust_id NUMBER
...... )
     PARTITION BY HASH (prod_id)
     PARTITIONS 2;

Partitioned Tables
A partitioned table consists of one or more partitions managed individually. And a nonpartitioned table cannot have partitions added to it.
A partitioned table is made up of one or more table partition segments. If you create a partitioned table named hash_products, then no table segment is allocated for this table.

Partitioned Indexes

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/26679417/viewspace-750450/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: Index Scan
请登录后发表评论 登录
全部评论

注册时间:2012-07-24

  • 博文量
    15
  • 访问量
    30391