Oracle partition index details

Source: Internet
Author: User
Syntax:
Table Index   CREATE [UNIQUE|BITMAP] INDEX [schema.]index_nameON [schema.]table_name [tbl_alias](col [ASC | DESC]) index_clause index_attribs

Index_clses:
There are two situations:

1. Local Index
The storage location of the index information depends on the Partition information of the parent table. In other words, to create such an index, the parent table must be Partition.
1.1 The index information is stored in the tablespace where the partition of the parent table is located. However, you can only create a HashTable or composite partition table in the parent table.
    LOCAL STORE IN (tablespace)
1.2 you can only create a HashTable or composite partition table in the parent table. And the specified number of partitions must be the same as the number of partitions IN the parent table. 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 The index information is stored in the tablespace where the partition of the parent table is located. This syntax is the simplest and is also the most commonly used partition index creation method.
Local
1.4 and the number of specified partitions must be the same as that of the parent table. LOCAL (Partition [Partition[LOGGING | NOLOGGING] [TABLESPACE {Tablespace| DEFAULT}] [PCTFREEInt] [PCTUSEDInt] [INITRANSInt] [MAXTRANSInt] [STORAGE storage_clause] [store in {Tablespace_name| DEFAULT] [SUBPARTITION [Subpartition[TABLESPACETablespace])
Global Index
The storage location of the index information is completely irrelevant to the Partition information of the parent table. It doesn't even matter if the parent table is a partition table. Syntax:Global partition by range (col_list) (PARTITIONPartitionValues less (Value_list) [LOGGING | NOLOGGING] [TABLESPACE {Tablespace| DEFAULT}] [PCTFREEInt] [PCTUSEDInt] [INITRANSInt] [MAXTRANSInt] [STORAGE storage_clause])
However, in this case, if the parent table is a partition table, you must update Global Index to delete all partitions of the parent table. Otherwise, the Index information is incorrect.
Alter table TableName drop partition PartitionNameUpdate Global Indexes
I did not go into any situations and which method is more effective. But my personal feeling is:Simple is the best

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.