Orcle 12c supports advanced new features --- Index compression

1 Description

Advanced Index Compression works well on all supported indexes, including those indexes that are not good candidates for the existing prefix compression feature; including indexes with no, or few, duplicate values in the leading columns of the index.

High index compression used on all supported indexes are very good, including those that do not fit the existing index prefix compression properties;
included in the index of leading column is not indexed or less duplicate values.

Advanced Index Compression improves the compression ratios significantly while still providing efficient access to the index.

High index compression greatly improving the compression ratio, while still accessing the index very efficient.

Experiment 2

Before enabling senior index compression, and databases must be 12.1.0 or later. Compression level: LOW, HIGH

2.1 Create a table and insert data

SQL> conn lei/lei@lei1;

Connected.

SQL> create table cndba_t as select * from dba_objects;

Table created.

 
SQL> insert into cndba_t select * from cndba_t;

81053 rows created.

 
SQL> /

162106 rows created.

Create a regular index 2.2

SQL> create index cndba_ind on cndba_t(object_name);

Index created.

- View index size

SQL> select segment_name ,sum(bytes)/1024/1024

from user_segments

where segment_type ='INDEX'

and SEGMENT_NAME ='CNDBA_IND'

group by segment_name;  2    3    4    5  


SEGMENT_NAME	   SUM(BYTES)/1024/1024
------------------ --------------------
CNDBA_IND	     17  --大小为17M

2.2.1 The restructuring of the existing index advanced compression index

Cndba_ind index will now be reconstructed as advanced compression index

SQL> ALTER INDEX CNDBA_IND REBUILD COMPRESS ADVANCED LOW;

Index altered.

- View index size again

SQL> select segment_name ,sum(bytes)/1024/1024

from user_segments

where segment_type ='INDEX'

and SEGMENT_NAME ='CNDBA_IND'

group by segment_name;  2    3    4    5  

 
SEGMENT_NAME	   SUM(BYTES)/1024/1024
------------------ --------------------
CNDBA_IND	      8  --大小为8M,可以看到几乎减少了一半的大小。

2.3 Create advanced compression index

SQL> CREATE INDEX CNDBA_IND ON CNDBA_T(object_name) COMPRESS ADVANCED LOW;

Index created.

- View index size

SQL> select segment_name ,sum(bytes)/1024/1024

from user_segments

where segment_type ='INDEX'

and SEGMENT_NAME ='CNDBA_IND'

group by segment_name;  2    3    4    5  


SEGMENT_NAME	   SUM(BYTES)/1024/1024
------------------ --------------------
CNDBA_IND	      8   -大小不变

Guess you like

Origin blog.csdn.net/qianglei6077/article/details/92980713