`
473687880
  • 浏览: 484871 次
文章分类
社区版块
存档分类
最新评论

Partitioned Indexes

 
阅读更多

Partitioned Indexes

A partitioned index is an index that, like a partitioned table, has been decomposed into smaller and more manageable pieces. Global indexes are partitioned independently of the table on which they are created, whereas local indexes are automatically linked to the partitioning method for a table. Like partitioned tables, partitioned indexes improve manageability, availability, performance, and scalability.
The following graphic shows index partitioning options.



Local Partitioned Indexes

In a local partitioned index, the index is partitioned on the same columns, with the same number of partitions and the same partition bounds as its table. Each index partition is associated with exactly one partition of the underlying table, so that all keys in an index partition refer only to rows stored in a single table partition. In this way, the database automatically synchronizes index partitions with their associated table partitions, making each table-index pair independent.
Local partitioned indexes are common in data warehousing environments. Local indexes offer the following advantages:
■Availability is increased because actions that make data invalid or unavailable in a partition affect this partition only.
■Partition maintenance is simplified. When moving a table partition, or when data ages out of a partition, only the associated local index partition must be rebuilt or maintained. In a global index, all index partitions must be rebuilt or maintained.
■If point-in-time recovery of a partition occurs, then the indexes can be recovered to the recovery time (see "Data File Recovery" on page 18-14). The entire index does not need to be rebuilt.
Example 4–4 shows the creation statement for the partitioned hash_sales table, using the prod_id column as partition key. Example 4–5 creates a local partitioned index on the time_id column of the hash_sales table.

Example 4–5 Local Partitioned Index
CREATE INDEX hash_sales_idx ON hash_sales(time_id) LOCAL;

In Figure 4–4, the hash_products table has two partitions, so hash_sales_idx has two partitions. Each index partition is associated with a different table partition. Index partition SYS_P38 indexes rows in table partition SYS_P33, whereas index partition SYS_P39 indexes rows in table partition SYS_P34.


You cannot explicitly add a partition to a local index. Instead, new partitions are added to local indexes only when you add a partition to the underlying table. Likewise, you cannot explicitly drop a partition from a local index. Instead, local index partitions are dropped only when you drop a partition from the underlying table.
Like other indexes, you can create a bitmap index on partitioned tables. The only restriction is that bitmap indexes must be local to the partitioned table—they cannot be global indexes. Global bitmap indexes are supported only on nonpartitioned tables.

Global Partitioned Indexes

A global partitioned index is a B-tree index that is partitioned independently of the underlying table on which it is created. A single index partition can point to any or all table partitions, whereas in a locally partitioned index, a one-to-one parity exists between index partitions and table partitions.
In general, global indexes are useful for OLTP applications, where rapid access, data integrity, and availability are important. In an OLTP system, a table may be partitioned by one key, for example, the employees.department_id column, but an application may need to access the data with many different keys, for example, by employee_id or job_id. Global indexes can be useful in this scenario.
You can partition a global index by range or by hash. If partitioned by range, then the database partitions the global index on the ranges of values from the table columns you specify in the column list. If partitioned by hash, then the database assigns rows to the partitions using a hash function on values in the partitioning key columns.
As an illustration, suppose that you create a global partitioned index on the time_range_sales table from Example 4–2. In this table, rows for sales from 1998 are stored in one partition, rows for sales from 1999 are in another, and so on. Example 4–6 creates a global index partitioned by range on the channel_id column.

Example 4–2 Range-Partitioned Table
CREATE TABLE time_range_sales
( prod_id NUMBER(6)
, cust_id NUMBER
, time_id DATE
, channel_id CHAR(1)
, promo_id NUMBER(6)
, quantity_sold NUMBER(3)
, amount_sold NUMBER(10,2)
)
PARTITION BY RANGE (time_id)
(PARTITION SALES_1998 VALUES LESS THAN (TO_DATE('01-JAN-1999','DD-MON-YYYY')),
PARTITION SALES_1999 VALUES LESS THAN (TO_DATE('01-JAN-2000','DD-MON-YYYY')),
PARTITION SALES_2000 VALUES LESS THAN (TO_DATE('01-JAN-2001','DD-MON-YYYY')),
PARTITION SALES_2001 VALUES LESS THAN (MAXVALUE)
);


Example 4–6 Global Partitioned Index
CREATE INDEX time_channel_sales_idx ON time_range_sales (channel_id)
GLOBAL PARTITION BY RANGE (channel_id)
(PARTITION p1 VALUES LESS THAN (3),
PARTITION p2 VALUES LESS THAN (4),
PARTITION p3 VALUES LESS THAN (MAXVALUE));

As shown in Figure 4–5, a global index partition can contain entries that point to multiple table partitions. Index partition p1 points to the rows with a channel_id of 2, index partition p2 points to the rows with a channel_id of 3, and index partition p3 points to the rows with a channel_id of 4 or 9.



分享到:
评论

相关推荐

    Expert.Oracle.Indexing.and.Access.Paths.2nd.epub

    Speed up the execution of important database queries ... Partitioned Indexes Chapter 7. Tuning Index Usage Chapter 8. Maintaining Indexes Chapter 9. SQL Tuning Advisor Chapter 10. In Memory Column Store

    Expert.Oracle.Indexing.and.Access.Paths

    Speed up the execution of important database...Chapter 6: Partitioned Indexes Chapter 7: Tuning Index Usage Chapter 8: Maintaining Indexes Chapter 9: SQL Tuning Advisor Chapter 10: In-Memory Column Store

    partitioned_elias_fano:用于论文“分区的 Elias-Fano 索引”中的实验的代码

    partitioned_elias_fano 注意:仅出于历史原因维护此存储库。 此代码现在是一部分。 该存储库包含用于论文中的实验的代码Giuseppe Ottaviano 和 Rossano Venturini,分区的 Elias-Fano 索引,ACM SIGIR 2014。构建...

    oracle教材,全面学习分区

    全面学习分区表及分区索引,关于分区表和分区索引(About Partitioned Tables and Indexes)

    Oracle数据库精讲之数据库管理_ Oracle数据库管理视频

    第十四讲:oracle Partitioned Tables and Indexes管理 第十五讲:oracle view管理 第十六讲:oracle sequences管理 第十七讲:oracle 触发器管理 第十八讲:oracle 用户管理 第十九讲:oracle 安装部署管理

    High Performance MySQL_3rd_edition

    With High Performance MySQL, you’ll learn advanced techniques for everything from designing schemas, indexes, and queries to tuning your MySQL server, operating system, and hardware to their fullest...

    Expert Oracle Database Architecture 2nd Edition

    confidently say things like “we should use a range partitioned IOT with these columns in the overflow for this table because … .” Tom combines three things in this book: a conversational style ...

    High Performance MySQL: Optimization, Backups, Replication, and More

    Learn how to design schemas, indexes, queries and advanced MySQL features for maximum performance, and get detailed guidance for tuning your MySQL server, operating system, and hardware to their ...

    oracle概念手册中英文对照版

    Chapter 18, Partitioned Tables and Indexes 第 18 章,分区表及分区索引 Chapter 19, Content Management 第 19 章,内容管理 Chapter 20, Database Security 第 20 章,数据库安全 Chapter 21, Data Integrity 第...

    Oracle Concepts 中英文对照版 (10g R2).rar

    Chapter 18, Partitioned Tables and Indexes 第 18 章,分区表及分区索引 Chapter 19, Content Management 第 19 章,内容管理 Chapter 20, Database Security 第 20 章,数据库安全 Chapter 21, Data ...

    oracle concepts概念手册中英文版(10gR2)

    Chapter 18, Partitioned Tables and Indexes 第 18 章,分区表及分区索引 Chapter 19, Content Management 第 19 章,内容管理 Chapter 20, Database Security 第 20 章,数据库安全 Chapter 21, Data Integrity...

    Oracle 10g Concepts 中文版

    Chapter 18, Partitioned Tables and Indexes 第 18 章,分区表及分区索引 Chapter 19, Content Management 第 19 章,内容管理 Chapter 20, Database Security 第 20 章,数据库安全 Chapter 21, Data Integrity...

    Oracle Concepts 中文版 (10g R2)

    Chapter 18, Partitioned Tables and Indexes 第 18 章,分区表及分区索引 Chapter 19, Content Management 第 19 章,内容管理 Chapter 20, Database Security 第 20 章,数据库安全 Chapter 21, Data Integrity...

    Oracle 10g r2 Concepts 手册(中英文对照阅读版本).chm

    Chapter 18, Partitioned Tables and Indexes 第 18 章,分区表及分区索引 Chapter 19, Content Management 第 19 章,内容管理 Chapter 20, Database Security 第 20 章,数据库安全 Chapter 21, Data Integrity...

    Oracle Concepts中英文对照版(10g R2).chm

    Backup and Recovery 第 15 章,备份与恢复 Chapter 16, Business Intelligence 第 16 章,业务智能 Chapter 17, High Availability 第 17 章,高可用性 Chapter 18, Partitioned Tables and Indexes ...

    Oracle Concepts 中文英文对照版 (10g R2)

    Backup and Recovery 第 15 章,备份与恢复 Chapter 16, Business Intelligence 第 16 章,业务智能 Chapter 17, High Availability 第 17 章,高可用性 Chapter 18, Partitioned Tables and Indexes ...

    Oracle - Partitioning Tips and Tricks (Arup Nanda)-计算机科学

    Partitioning: Tips and TricksArup Nanda ...• Index is partitioned exactly asthe table • Index entries of each part arefound in the corresponding partition in index only• When table partition is drop

Global site tag (gtag.js) - Google Analytics