文档

普通表索引

更新时间:

本文为您介绍迁移 Oracle 数据库的数据至 OceanBase 数据库 Oracle 租户时,CREATE INDEX DDL 普通表索引的支持转换范围。

总览

table_index_clause:
[ schema. ] table [ t_alias ]
(index_expr [ ASC | DESC ]
  [, index_expr [ ASC | DESC ] ]...)
  [ index_properties ]

index_properties:
[ { { global_partitioned_index
    | local_partitioned_index
    }
  | index_attributes
  }...
| INDEXTYPE IS { domain_index_clause
               | XMLIndex_clause
               }
]

global_partitioned_index:
GLOBAL PARTITION BY
   { RANGE (column_list)
        (index_partitioning_clause)
   | HASH (column_list)
        { individual_hash_partitions
        | hash_partitions_by_quantity
        }
   }


local_partitioned_index:
LOCAL
[ on_range_partitioned_table
| on_list_partitioned_table
| on_hash_partitioned_table
| on_comp_partitioned_table
]

index_attributes:
[ { physical_attributes_clause
  | logging_clause
  | ONLINE
  | TABLESPACE { tablespace | DEFAULT }
  | index_compression
  | { SORT | NOSORT }
  | REVERSE
  | VISIBLE | INVISIBLE
  | partial_index_clause
  | parallel_clause
  }...
]

domain_index_clause:
indextype
   [ local_domain_index_clause ]
   [ parallel_clause ]
   [ PARAMETERS ('ODCI_parameters') ]

XMLIndex_clause:
[XDB.] XMLINDEX [ local_XMLIndex_clause ]
                [ parallel_clause ]
  [ XMLIndex_parameters_clause ]

支持的范围

  • 支持 ASC | DESC 属性指定升序降序。示例如下:

    CREATE INDEX IDX ON T(C ASC);
    CREATE UNIQUE INDEX IDX ON T(C DESC);
  • 支持组合索引。

  • 支持函数索引。示例如下:

    CREATE INDEX IDX ON T(SUBSTR(C,1,4));
  • index_attributes 支持反向索引 REVERSE 属性。示例如下:

    CREATE INDEX IDX ON T(C) REVERSE;
  • 支持 global_partitioned_index 子句定义 global 索引分区。global_partitioned_index 的语法如下:

    table_index_clause:
    [ schema. ] table [ t_alias ]
    (index_expr [ ASC | DESC ]
      [, index_expr [ ASC | DESC ] ]...)
      [ index_properties ]
    
    index_properties:
    [ { { global_partitioned_index
        | local_partitioned_index
        }
      | index_attributes
      }...
    | INDEXTYPE IS { domain_index_clause
                   | XMLIndex_clause
                   }
    ]
    
    global_partitioned_index:
    GLOBAL PARTITION BY
       { RANGE (column_list)
            (index_partitioning_clause)
       | HASH (column_list)
            { individual_hash_partitions
            | hash_partitions_by_quantity
            }
       }
    
    
    local_partitioned_index:
    LOCAL
    [ on_range_partitioned_table
    | on_list_partitioned_table
    | on_hash_partitioned_table
    | on_comp_partitioned_table
    ]
    
    index_attributes:
    [ { physical_attributes_clause
      | logging_clause
      | ONLINE
      | TABLESPACE { tablespace | DEFAULT }
      | index_compression
      | { SORT | NOSORT }
      | REVERSE
      | VISIBLE | INVISIBLE
      | partial_index_clause
      | parallel_clause
      }...
    ]
    
    domain_index_clause:
    indextype
       [ local_domain_index_clause ]
       [ parallel_clause ]
       [ PARAMETERS ('ODCI_parameters') ]
    
    XMLIndex_clause:
    [XDB.] XMLINDEX [ local_XMLIndex_clause ]
                    [ parallel_clause ]
      [ XMLIndex_parameters_clause ]
    • 支持 GLOBAL PARTITION BY RANGE(column_name_list) 创建 GLOBAL RANGE 索引分区。

    • 支持 GLOBAL PARTITION BY HASH(column_name_list) 创建 GLOBAL HASH 索引分区。

    • 支持 index_partitioning_clause 子句定义 range 分区。

    • 支持 individual_hash_partitions 子句定义 hash 分区,详情请参见 自定义 hash 一级分区

    • 支持 hash_partitions_by_quantity 子句定义 hash 分区,详情请参见 指定 hash 一级分区数量

不支持的范围

  • 不支持 domain_index_clause 子句定义 domain index,会报错。

  • 不支持 XMLIndex_clause 定义 xml index 的子句,会报错。

忽略的属性

说明

如果同步的 DDL 中包含以下属性的定义,则这些属性不会被解析和转换,最终会被忽略。

  • global 索引分区定义 range 分区 index_partitioning_clause 中的 segment_attributes_clause 子句指定物理属性和表空间存储,会忽略该 option。

  • local_partitioned_index 子句索引分区定义,会忽略该 option。

  • index_attributes 目前仅支持反向索引 REVERSE,其它属性均忽略。

  • 本页导读 (0)
文档反馈