oracle deterministic關鍵字.
在看thomas kyte 的<
發現在它的書就提到的一個關鍵字.deterministic
DETERMINISTIC Clause
Specify DETERMINISTIC
to indicate that the function returns the same result value whenever it is called with the same values for its arguments.
You must specify this keyword if you intend to call the function in the expression of a function-based index or from the query of a materialized view that is marked REFRESH
FAST
or ENABLE
QUERY
REWRITE
. When Oracle Database encounters a deterministic function in one of these contexts, it attempts to use previously calculated results when possible rather than reexecuting the function. If you subsequently change the semantics of the function, you must manually rebuild all dependent function-based indexes and materialized views.
Do not specify this clause to define a function that uses package variables or that accesses the database in any way that might affect the return result of the function. The results of doing so will not be captured if Oracle Database chooses not to reexecute the function.
The following semantic rules govern the use of the DETERMINISTIC
clause:
You can declare a top-level subprogram
DETERMINISTIC
.You can declare a package-level subprogram
DETERMINISTIC
in the package specification but not in the package body.You cannot declare
DETERMINISTIC
a private subprogram (declared inside another subprogram or inside a package body).A
DETERMINISTIC
subprogram can call another subprogram whether the called program is declaredDETERMINISTIC
or not.
看了下oracle的官方文件,這個關鍵字表明:如果你的函式當輸入一樣時,會返回同樣的結果.
這樣, 資料庫就用前一個計算的值,而不需要再重新計算一次.
這對於使用函式索引等,會直到相當大的好處.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/197458/viewspace-1019311/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle關鍵字Oracle
- ORACLE中ESCAPE關鍵字用法Oracle
- Oracle Deterministic FunctionOracleFunction
- this關鍵字
- 關鍵字
- 搜尋Oracle DDL中的關鍵字Oracle
- abstract關鍵字 super 關鍵字 類與繼承繼承
- out關鍵字和ref關鍵字的區別
- ORACLE 查詢條件出現關鍵字:&Oracle
- Swift 關鍵字Swift
- typedef關鍵字
- Synchronized關鍵字synchronized
- JavaScript this關鍵字JavaScript
- Swift —— 關鍵字Swift
- Auto關鍵字
- [JavaScript] this 關鍵字JavaScript
- 4關鍵字
- super關鍵字
- synchronized 關鍵字synchronized
- static關鍵字
- Google關鍵字工具Go
- Synchronize 關鍵字原理
- [java]transient關鍵字Java
- 使用 Synchronized 關鍵字synchronized
- c#關鍵字C#
- java中this關鍵字Java
- 多關鍵字排序排序
- JavaScript中this關鍵字JavaScript
- java transient關鍵字Java
- javascript的this關鍵字JavaScript
- volitile關鍵字
- java之this關鍵字Java
- 完全理解關鍵字this
- Voliate關鍵字
- synchronize關鍵字 原理
- 各類關鍵字
- final關鍵字
- const關鍵字