predicate 列存储索引扫描_唯一性索引(unique index)与普通索引(normal index)差异(上)(唯一性索引 (singl ...

论坛 期权论坛 编程之家     
选择匿名的用户   2021-6-2 01:01   11   0

唯一性索引(unique index)与普通索引(normal index)差异(上)(唯一性索引 (single index 与普通索引 (standard index) 差异 (上))

唯一性索引(unique index)与普通索引(normal index)差异(上)(唯一性索引 (single index 与普通索引 (standard index) 差异 (上))

Unique index (Unique Index) and common index (Normal Index) difference (on)

The classification of individuals: the working mechanism of Oracle

The index is a database search optimization method we often use. Business scenarios appropriate use of appropriate indexing scheme can improve system performance and user experience significantly. In Oracle, there are many types including index. Different types of index system to adapt to the environment and access to different scenes. Among them, the only index Unique is a Index we often use to.

The only difference index unique index and normal index is the most general index adds a layer of unique constraint on the column index on. Add unique index data columns can be empty, but as long as there are data values, it must be the only.

Then, in the use of unique index, what is the difference with the general index? The following is explained through a series of demonstration experiment.

1, the experimental environment for

In order to reflect the difference between consistency and possible, choose the same data value added index structure of different types.

SQL> select * from v$version where rownum<2;

BANNER

--------------------------------------------------------------------------------

Oracle Database11gEnterpriseEdition Release11.2.0.1.0 - Production

SQL> create table t as select * from dba_objects;

Table created

Data_object_id and object_id are the same / guarantee;

SQL> update t set data_object_id=object_id;

72581 rows updated

SQL> commit;

Commit complete

/ / index

SQL> create index idx_t_normalid on t (object_id);

Index created

/ / unique index

SQL> create unique index idx_t_uniid on t (data_object_id);

Index created

SQL> exec dbms_stats.gather_table_stats (user,'T', cascade = true);

PL/SQL procedure successfully completed

2, volume comparison

In preparation, we will set the value for the same index column, try to avoid because

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP