首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >函数索引构成虚拟隐藏列

函数索引构成虚拟隐藏列

作者头像
bisal
发布2019-08-18 13:15:51
9070
发布2019-08-18 13:15:51
举报

enq: TM - contention锁争用的解决》中提到了SYS_NC00004$,理解不是很明白,于是在OTN上发了帖子咨询了下,

640?wx_fmt=png
640?wx_fmt=png

从回复看,SYS_NC00004$就是原始列名,只是他是个虚拟隐藏的列,并且数据默认值是“原始列”,即函数表达式作用的列,

The "construction rule" is the original column. If you query dba_tab_cols you'll see that sys_nc00004$ is a virtual hidden column with its data_default being the original column.

检索user_tab_cols视图,

SQL> select table_name, column_name, data_type, data_default, hidden_column, virtual_column,qualified_col_name from user_tab_cols where table_name='PRODUCT';
qualified_col_name from user_tab_cols where table_name='PRODUCT';

P.S. user_tab_cols和user_tab_columns相比,有些列未做过滤。

DBA_TAB_COLS describes the columns of all tables, views, and clusters in the database. This view differs from "DBA_TAB_COLUMNS" in that hidden columns are not filtered out. Its columns are the same as those in "ALL_TAB_COLS". To gather statistics for this view, use the DBMS_STATS package.

可以看出来,PRODUCT表确实除了正常的三个字段外,多了一个列名SYS_NC00004$的字段,数据类型是RAW的,只有他含默认值,带引号的"SUPPLIER_ID",应该就是对SUPPLIER_ID加了函数,HIDDEN_COLUMN和VIRTUAL_COLUMN都是YES,他是一个虚拟隐藏列,

640?wx_fmt=png
640?wx_fmt=png

只能赞叹Oracle的博大精深,各种小知识点,层出不穷,应接不暇。。。

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2019年07月16日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档