惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 叶小钗
MyScale Blog
MyScale Blog
博客园 - 【当耐特】
I
InfoQ
腾讯CDC
aimingoo的专栏
aimingoo的专栏
L
LangChain Blog
人人都是产品经理
人人都是产品经理
D
DataBreaches.Net
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Engineering at Meta
Engineering at Meta
A
About on SuperTechFans
Google DeepMind News
Google DeepMind News
Vercel News
Vercel News
C
Check Point Blog
B
Blog RSS Feed
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
美团技术团队
Stack Overflow Blog
Stack Overflow Blog
Y
Y Combinator Blog
D
Docker
MongoDB | Blog
MongoDB | Blog
量子位
博客园_首页

博客园 - AK47+

项目总结 (转)racle 9i 数据库设计指引全集(4) (转)Oracle 9i 数据库设计指引全集(3) (转)Oracle 9i 数据库设计指引全集(2) (转)Oracle 9i 数据库设计指引全集(1) (转)关于Oracle数据库中索引的维护经验谈 (转)oracle 分区表的建立方法 (转)关于oracle表空间的规划方法 oracle startup时 ORA-00600错误解决 转:何时使用绑定变量性能反而差 (转)ORACLE 中ROWNUM用法总结! 跪求思路:大批量数据导出 阳春三月,放飞希望---希望今年不再碌碌无为 仓颉如果来做软件,一定是一位开山式人物 关于面试的一点感受 复习功课:对进程、线程、应用程序域的理解 园子里的兄弟,谁到这家公司面试过,来评一下笔试题了 推荐:一道让我惦记了一年的机试题 两个异常:a circular reference was detected while serializing及 Maximum length exceeded
(转)Oracle 分区索引详解
AK47+ · 2009-02-27 · via 博客园 - AK47+

语法:

Table Index
   CREATE [UNIQUE|BITMAP] INDEX [schema.]index_name
ON [schema.]table_name [tbl_alias]
(col [ASC | DESC]) index_clause index_attribs

index_clauses:
分以下两种情况

1. Local Index

   就是索引信息的存放位置依赖于父表的Partition信息,换句话说创建这样的索引必须保证父表是Partition
1.1 索引信息存放在父表的分区所在的表空间。但是仅可以创建在父表为HashTable或者composite分区表的。
    LOCAL STORE IN (tablespace)
1.2 仅可以创建在父表为HashTable或者composite分区表的。并且指定的分区数目要与父表的分区数目要一致
LOCAL STORE IN (tablespace)
  (PARTITION [partition
       [LOGGING|NOLOGGING]
       [TABLESPACE {tablespace|DEFAULT}]
       [PCTFREE int]
       [PCTUSED int]
       [INITRANS int]
       [MAXTRANS int]
       [STORAGE storage_clause]
       [STORE IN {tablespace_name|DEFAULT]
       [SUBPARTITION [subpartition [TABLESPACE tablespace]]]])
 
1.3 索引信息存放在父表的分区所在的表空间,这种语法最简单,也是最常用的分区索引创建方式。
    Local
1.4 并且指定的Partition 数目要与父表的Partition要一致 LOCAL (PARTITION [partition [LOGGING|NOLOGGING] [TABLESPACE {tablespace|DEFAULT}] [PCTFREE int] [PCTUSED int] [INITRANS int] [MAXTRANS int] [STORAGE storage_clause] [STORE IN {tablespace_name|DEFAULT] [SUBPARTITION [subpartition [TABLESPACE tablespace]]]])

Global Index

  索引信息的存放位置与父表的Partition信息完全不相干。甚至父表是不是分区表都无所谓的。语法如下:
GLOBAL PARTITION BY RANGE (col_list)
( PARTITION partition VALUES LESS THAN (value_list)
[LOGGING|NOLOGGING]
[TABLESPACE {tablespace|DEFAULT}]
[PCTFREE int]
[PCTUSED int]
[INITRANS int]
[MAXTRANS int]
[STORAGE storage_clause] )
但是在这种情况下,如果父表是分区表,要删除父表的一个分区都必须要更新Global Index ,否则索引信息不正确
ALTER TABLE TableName DROP PARTITION PartitionName  Update Global Indexes