Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: deterministic functions

RE: deterministic functions

From: Jamadagni, Rajendra <rajendra.jamadagni_at_espn.com>
Date: Wed, 9 Aug 2000 08:36:45 -0400
Message-Id: <10584.114168@fatcity.com>


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



Rajendra Jamadagni MIS, ESPN Inc. Rajendra dot Jamadagni at ESPN dot com
QOTD: Any clod can have facts, but having an opinion is an art ! Any opinion expressed here is personal and doesn't reflect that of ESPN Inc.

------_=_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&#8217;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&#8217;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>&nbsp;</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> 

<BR><B><FONT color=#0000ff size=2>Rajendra
Jamadagni&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MIS, ESPN Inc.</FONT></B> <BR><FONT color=#0000ff size=1>Rajendra dot Jamadagni at ESPN dot com</FONT> <BR><FONT color=#0000ff size=1>QOTD: Any clod can have facts, but having an opinion is an art !</FONT> <BR><FONT color=#0000ff size=1>Any opinion expressed here is personal and doesn't reflect that of ESPN Inc.</FONT><FONT color=#0000ff face=Arial size=1> </FONT></DIV>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px"></BLOCKQUOTE></BODY></HTML>
Received on Wed Aug 09 2000 - 07:36:45 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US