基于Oracle函数的索引 [英] Oracle function based indexes

查看:146
本文介绍了基于Oracle函数的索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能是一个愚蠢的问题,但使用基于函数的索引是否安全。我的意思是,当列更改时,索引会立即更改吗?

Maybe a silly question, but is it safe to use a function based indexes. I mean, when the column changes is the index changed right away?

推荐答案

假设它们设置正确,是的。

Assuming they are setup correctly, Yes.

概述:
Oracle使用基于函数的索引在表上创建一个隐藏列,每次更改基于函数的索引的列时都会更新该列;假设值是确定性的(有关详细信息,请参阅oracle链接)。您可以通过查询创建基于函数的索引的表的系统对象all_tab_cols来查看这些隐藏的列。它们通常包含$并且看起来像SYS_NC00005 $。

OVERVIEW: Oracle creates a hidden column on the table with the function based index which is updated each time the columns on which the function based index are changed; assuming the values are deterministic (See oracle link for more info). You can see these hidden columns by querying the system object all_tab_cols your table on which the function based index was created. They typically contain a $ and look something like SYS_NC00005$.

它们通常用于处理区分大小写或处理重复函数调用时执行的开销。函数调用具有这样的频率:使得计算值一次并保留它的前期值导致性能增益。

They are often used when you want to handle case sensitivity or handle repeated functions calls on which the overhead of executing the function call is with such frequency that the value up front time of computing the value once and retaining it results in a performance gain.

补充阅读:

  • Ask Tom
  • Stack Overflow
  • ORACLE

这篇关于基于Oracle函数的索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆