Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: deterministic functions
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C001FE.7A75D53C
Content-Type: text/plain;
charset="iso-8859-1"
DETERMINISTIC is an optimization hint that allows the system to use a saved copy of the function's return result (if such a copy is available). The saved copy could come from a materialized view, a function-based index, or a redundant call to the same function in the same SQL statement. The query optimizer can choose whether to use the saved copy or re-call the function. The function should reliably return the same result value whenever it is called with the same values for its arguments. Therefore, do not define the function to use package variables or to access the database in any way that might affect the function's return result, because the results of doing so will not be captured if the system chooses not to call the function. A function must be declared DETERMINISTIC in order to be called in the expression of a function-based index, or from the query of a materialized view if that view is marked REFRESH FAST or ENABLE QUERY REWRITE.
This straight from SQL manual ...
HTH
Raj
------_=_NextPart_001_01C001FE.7A75D53C
Content-Type: text/html;
charset="iso-8859-1"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META content="MSHTML 5.00.2919.6307" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><SPAN class=305323112-09082000>
<P><FONT size=2><FONT color=#000080><FONT face=Tahoma>DETERMINISTIC is an
optimization hint that allows the system to use a saved copy of the function’s
return<SPAN class=305323112-09082000> </SPAN></FONT><FONT face=Tahoma>result (if
such a copy is available). The saved copy could come from a materialized view,
a<SPAN class=305323112-09082000> </SPAN></FONT><FONT face=Tahoma>function-based
index, or a redundant call to the same function in the same SQL statement.<SPAN
class=305323112-09082000> </SPAN></FONT><FONT face=Tahoma>The query optimizer
can choose whether to use the saved copy or re-call the function.<SPAN
class=305323112-09082000> </SPAN></FONT><FONT face=Tahoma>The function should
reliably return the same result value whenever it is called with the same<SPAN
class=305323112-09082000> </SPAN>values for its arguments. Therefore, do not
define the function to use package variables or to<SPAN
class=305323112-09082000> </SPAN></FONT></FONT><FONT color=#000080><FONT
face=Tahoma>access the database in any way that might affect the function’s
return result, because the<SPAN class=305323112-09082000>
</SPAN></FONT></FONT><FONT color=#000080><FONT face=Tahoma>results of doing so
will not be captured if the system chooses not to call the function.<SPAN
class=305323112-09082000> </SPAN></FONT></FONT><FONT color=#000080><FONT
face=Tahoma>A function must be declared DETERMINISTIC in order to be called in
the expression of a<SPAN class=305323112-09082000> </SPAN></FONT></FONT><FONT
color=#000080><FONT face=Tahoma>function-based index, or from the query of a
materialized view if that view is marked<SPAN class=305323112-09082000>
</SPAN></FONT></FONT></FONT><FONT color=#000080 face=Tahoma size=2>REFRESH FAST
or ENABLE QUERY REWRITE.</FONT></P></SPAN></DIV>
<DIV><FONT color=#000080 size=2><SPAN class=305323112-09082000>This straight
from SQL manual ...</SPAN></FONT></DIV>
<DIV><FONT color=#000080 size=2><SPAN
class=305323112-09082000></SPAN></FONT> </DIV>
<DIV><FONT color=#000080 size=2><SPAN
class=305323112-09082000>HTH</SPAN></FONT></DIV>
<DIV><FONT color=#000080 size=2><SPAN
class=305323112-09082000>Raj</SPAN></FONT></DIV>
<DIV><FONT color=#000080 size=2><SPAN
class=305323112-09082000></SPAN></FONT><FONT
size=2>______________________________________________________</FONT>