Oracle function based indexes

旧巷老猫 提交于 2020-01-05 05:56:27

问题


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?


回答1:


Assuming they are setup correctly, Yes.

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.

Additional reading:

  • Ask Tom
  • Stack Overflow
  • ORACLE


来源:https://stackoverflow.com/questions/10141498/oracle-function-based-indexes

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!