11.07.2015 Views

Oracle Database 11 g - Online Public Access Catalog

Oracle Database 11 g - Online Public Access Catalog

Oracle Database 11 g - Online Public Access Catalog

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

186 CHAPTER 4 ■ PERFORMANCE MANAGEMENTHere’s a query that shows the type, status, and name of objects in the result cache:SQL> select type,status,name from v$result_cache_objects;TYPE STATUS NAME---------------- ------------ -------------------------------Dependency Published HR.COUNT_EMPDependency Published HR.EMPLOYEESResult Published "HR"."COUNT_EMP"::8."COUNTEMP"#fac892c7867b54c6 #1Result Published select /*+ result_cache q_name(Q1) */last_name,salary from hr.employeesorder by salarySQL>The output of the previous query shows that there are two cached results in the resultcache, and that both are available for use.The following limitations apply with regard to the operation of the query result cache:• When dealing with bind variables, a query can reuse a cached result only for identicalvariable values. Different values for the bind variables or different bind variable nameslead to a cache miss.• <strong>Oracle</strong> won’t cache results if the query uses a noncurrent version of the data because ofthe enforcement of the read consistency principle.• <strong>Oracle</strong> won’t cache results if there are pending transactions on the tables that are part ofthe query.• <strong>Oracle</strong> won’t cache flashback queries.• All queries containing the following are ineligible for query result caching:• Nondeterministic PL/SQL functions• Currval and nextval• SQL functions such as sysdata and current_date• Temporary tables• Dictionary tablesPL/SQL Function Result CachePL/SQL functions sometimes return results of computations performed by queries thatinvolve PL/SQL functions. When you’re dealing with frequently executed PL/SQL functionswhose queries access infrequently changing data, the PL/SQL function result cache feature letsyou specify that the function’s results be cached. Once you do this, when the database invokesa function with similar arguments as the cached function, instead of reexecuting that function,the database returns the cached results of the earlier execution of that function instead. Of course,

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!