簡體   English   中英

在Oracle中刪除其中一列時,多列索引(復合)會發生什么

[英]What will happen to a multicolumn index (Composite) when one of the column is dropped in Oracle

我在表中有columnA,ColumnB以及由這兩列構成的復合索引。 現在,我從表中刪除ColumnB。 現在索引會發生什么? 我現在應該單獨使用ColumnA重新創建索引嗎?

一個簡單的測試:

SQL> create table t (c1 number, c2 number);

Table created.

SQL> create index i on t(c1, c2);

Index created.

SQL> select index_name
  2  from user_indexes
  3  where table_name = 'T';

INDEX_NAME
------------------------------
I

SQL> alter table t drop column c2;

Table altered.

SQL> select index_name
  2  from user_indexes
  3  where table_name = 'T';

no rows selected

SQL>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM