Google Search

Thursday, August 25, 2011

Function RESULT_CACHE

One of the new feature in Oracle 11G is Function result cache. This might provide huge performance benifits for applications.

If you create a function with RESULT_CACHE keyword, then oracle caches the result of the function in SGA.

When you call the function next time with same parameters, then function will not get executed at all, instead result will be returned from cache.

This saves us lot of time and improves the performance of overall process.

When ever any changes are made to underlying tables the cache is invalidated.
Hence the best results are got when you use this against tables which has more selects than inserts and updates.

Managing Function Result Cache:
1. RESULT_CACHE_MAX_SIZE parameter: Maximum amount of SGA memory that function result cache can use.
2. DBMS_RESULT_CACHE Package: Supplied package offers a set of subprograms to manage the contents of the cache.
3. Dyanamic performance views : V$RESULT_CACHE_STATISTICS, V$RESULT_CACHE_MEMORY,V$RESULT_CACHE_OBJECTS,V$RESULT_CACHE_DEPENDENCY.

No comments:

Post a Comment