ITPub博客

首页 > 数据库 > Oracle > [20181026]12c Attribute Clustering特性2.txt

[20181026]12c Attribute Clustering特性2.txt

原创 Oracle 作者:lfree 时间:2018-10-26 22:30:33 0 删除 编辑

[20181026]12c Attribute Clustering特性2.txt

Attribute Clustering实际上按照特定的字段组织表,使相同的值聚集起来,总的来讲就是减少索引的聚集因子.

One of the really cool new features introduced in 12.1.0.2 is Attribute Clustering. This new table based attribute
allows you to very easily cluster data in close physical proximity based on the content of specific columns.

--//主要了解信息记录在那个表。

1.环境:
SCOTT@test01p> @ ver1
PORT_STRING                    VERSION        BANNER                                                                               CON_ID
------------------------------ -------------- -------------------------------------------------------------------------------- ----------
IBMPC/WIN_NT64-9.1.0           12.2.0.1.0     Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production              0

2.测试:
SCOTT@test01p> @ 10046on 12
Session altered.

SCOTT@test01p> create table ziggy2 (id number, code number, name varchar2(30)) clustering by linear order (code,name) without materialized zonemap;
Table created.

SCOTT@test01p> @ 10046off
Session altered.

--//检查跟踪执行如下:
insert into clst$ (clstobj#, clstfunc, flags) values(:1, :2, :3)
insert into clstkey$ (clstobj#, tabobj#, intcol#, position, groupid) values (:1, :2, :3, :4, :5)


SCOTT@test01p> select * from sys.clst$ where clstobj# in (select object_id from dba_objects where owner=user and object_name='ZIGGY2');
  CLSTOBJ#   CLSTFUNC CLSTLASTDM CLSTLASTLOAD FLAGS
---------- ---------- ---------- ------------ -----
     22899          2                             3

SCOTT@test01p> select * from sys.clstkey$ where clstobj# in (select object_id from dba_objects where owner=user and object_name='ZIGGY2');
  CLSTOBJ#    TABOBJ#    INTCOL#   POSITION    GROUPID
---------- ---------- ---------- ---------- ----------
     22899      22899          2          1          0
     22899      22899          3          2          0

--// clustering by linear order (code,name) ,2个字段基本能对上。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/267265/viewspace-2217741/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
熟悉oracle相关技术,擅长sql优化,rman备份与恢复,熟悉linux shell编程。

注册时间:2008-01-03

  • 博文量
    2627
  • 访问量
    6393092