{"id":2438,"date":"2012-01-05T20:22:00","date_gmt":"2012-01-05T19:22:00","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/query-result-cache-overview-in-oracle-11g\/"},"modified":"2012-01-05T20:22:00","modified_gmt":"2012-01-05T19:22:00","slug":"query-result-cache-overview-in-oracle-11g","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/query-result-cache-overview-in-oracle-11g\/","title":{"rendered":"&#8216;Query result cache&#8217; in Oracle 11g"},"content":{"rendered":"<p>Oracle has introduced three new caching features in its Oracle 11g release:<\/p>\n<ul>\n<li>Query result cache<\/li>\n<li>Client OCI result cache<\/li>\n<li>PL\/SQL function result cache<\/li>\n<\/ul>\n<p>In this posting, I will present the query result cache feature.<\/p>\n<p>In addition to existing caches, the query result cache feature keeps query results in the shared pool. By caching a query result, Oracle can directly return the cached result set and avoid not only physical reads if needed but also data computing (grouping or sorting for example). Result cache is also shared between all sessions, so when a query result is in the cache, all users can use the cached result set instead of consuming server resources.<\/p>\n<h3>Configuration<\/h3>\n<p>Just take a look on how result cache can be configured. There are 6 parameters to configure result caching feature.<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\"><code><\/code>SQL&gt; show parameters result\nNAME \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0TYPE \u00a0 \u00a0 \u00a0 \u00a0VALUE\n------------------------------------ ----------- ------------------------------\nclient_result_cache_lag \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0big integer 3000\nclient_result_cache_size \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 big integer 0\nresult_cache_max_result \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0integer \u00a0 \u00a0 5\nresult_cache_max_size \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0big integer 4M\nresult_cache_mode \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0string \u00a0 \u00a0 \u00a0MANUAL\nresult_cache_remote_expiration \u00a0 \u00a0 \u00a0 integer \u00a0 \u00a0 0<\/pre>\n<p>The client_result_cache_lag and client_result_cache_size parameters will not be discussed here as they are concerning client result cache feature.<\/p>\n<p>Two parameters are dynamic system parameters:<\/p>\n<ul>\n<li>result_cache_max_size: configure the maximum amount of memory the database instance can use for result cache feature. If AMM (Automatic Memory Management) is enabled, the size is derived from the values of SHARED_POOL_SIZE, SGA_TARGET and MEMORY_TARGET. Note that if result_cache_max_size is set to 0, the result cache is disabled.<\/li>\n<li>result_cache_max_result: percentage of result_cache_max_size that any single result set can use. For example, on my test environment, if a result set is bigger than 204K, it will not be cached (4096K * 0.05 = 204.8K).<\/li>\n<\/ul>\n<p>The last two parameters can be set at session or system level:<\/p>\n<ul>\n<li>result_cache_mode: set how database keep results, two values are possible.<br \/>\nMANUAL: only results of queries with the hint RESULT_CACHE are cached if the result set matches the memory condition<br \/>\nFORCE: all results that could be cached are put in result cache unless NO_RESULT_CACHE hint is present in the query<\/li>\n<li>result_cache_remote_expiration: set an expiration time for result set on distant objects. When this parameter is set to 0, result cache for distant objects is disabled.<br \/>\nSetting this parameter allows to keep in the cache results which can be stale because Oracle cannot invalidate the cache if the remote table is updated in remote database instance.<\/li>\n<\/ul>\n<h3>Cache management<\/h3>\n<p>Oracle maintains 4 dynamic views to check result cache usage and statistics:<\/p>\n<ul>\n<li>V$RESULT_CACHE_OBJECTS: cached objects and attributes<\/li>\n<li>V$RESULT_CACHE_DEPENDENCY: dependency between cached objects<\/li>\n<li>V$RESULT_CACHE_MEMORY: result cache memory usage<\/li>\n<li>V$RESULT_CACHE_STATISTICS: memory usage and statistics<\/li>\n<\/ul>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">SQL&gt; select * from V$RESULT_CACHE_STATISTICS;\n\u00a0ID \u00a0 \u00a0 \u00a0 \u00a0NAME \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 VALUE\n---------- ---------------------------------------- ----------------------------------------\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a01 Block Size (Bytes) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 1024\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a02 Block Count Maximum \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a04096\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a03 Block Count Current \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a00\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a04 Result Size Maximum (Blocks) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 204\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a05 Create Count Success \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 0\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a06 Create Count Failure \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 0\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a07 Find Count \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 0\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a08 Invalidation Count \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 0\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a09 Delete Count Invalid \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 0\n\u00a0 \u00a0 \u00a0 \u00a0 10 Delete Count Valid \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 0\n\u00a0 \u00a0 \u00a0 \u00a0 11 Hash Chain Length \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a00\n\u00a0 \u00a0 \u00a0 \u00a0 12 Find Copy Count \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a00\n12 rows selected.<\/pre>\n<p>Result cache uses its own block size to stock result sets which is different from database block size.<br \/>\nTo manage result cache feature through PL\/SQL, there is a package called <a href=\"http:\/\/docs.oracle.com\/cd\/B28359_01\/appdev.111\/b28419\/d_result_cache.htm\">DBMS_RESULT_CACHE<\/a>. This package contains procedures and functions to check memory usage, flush the cache, etc. For example, the procedure memory_report prints a report on the feature memory usage.<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\"><code><\/code>SQL&gt; set serveroutput on\nSQL&gt; exec DBMS_RESULT_CACHE.Memory_Report();\nR e s u l t \u00a0 C a c h e \u00a0 M e m o r y \u00a0 R e p o r t\n[Parameters]Block Size \u00a0 \u00a0 \u00a0 \u00a0 \u00a0= 1K bytes\nMaximum Cache Size \u00a0= 4M bytes (4K blocks)\nMaximum Result Size = 204K bytes (204 blocks)\n[Memory]\nTotal Memory = 5180 bytes [0.004% of the Shared Pool]\n... Fixed Memory = 5180 bytes [0.004% of the Shared Pool]\n... Dynamic Memory = 0 bytes [0.000% of the Shared Pool]\nPL\/SQL procedure successfully completed.<\/pre>\n<h3>Basic result cache tests<\/h3>\n<p>All tests will be run with Oracle sample schema SH. First, I try to execute twice the same statement without result cache (which is the default).<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">SQL&gt; set lines 150\nSQL&gt; set timing on\nSQL&gt; set autotrace traceonly explain\nSQL&gt; SELECT CUST_CITY, COUNT(*) FROM CUSTOMERS GROUP BY CUST_CITY;\n620 rows selected.\nElapsed: 00:00:00.31\nSQL&gt; SELECT CUST_CITY, COUNT(*) FROM CUSTOMERS GROUP BY CUST_CITY;\n620 rows selected.\nElapsed: 00:00:00.04\nExecution Plan\n----------------------------------------------------------\nPlan hash value: 1577413243\n--------------------------------------------------------------------------------\n| Id \u00a0| Operation \u00a0 \u00a0 \u00a0 \u00a0 \u00a0| Name \u00a0 \u00a0 \u00a0| Rows \u00a0| Bytes | Cost (%CPU)| Time \u00a0 \u00a0 |\n--------------------------------------------------------------------------------\n| \u00a0 0 | SELECT STATEMENT \u00a0 | \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 | \u00a0 620 | \u00a06200 | \u00a0 407 \u00a0 (1)| 00:00:05 |\n| \u00a0 1 | \u00a0HASH GROUP BY \u00a0 \u00a0 | \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 | \u00a0 620 | \u00a06200 | \u00a0 407 \u00a0 (1)| 00:00:05 |\n| \u00a0 2 | \u00a0 TABLE ACCESS FULL| CUSTOMERS | 55500 | \u00a0 541K| \u00a0 405 \u00a0 (1)| 00:00:05 |\n--------------------------------------------------------------------------------<\/pre>\n<p>Here, we see the effect of the existing caches, the second execution taking less time. As the two statements share the same execution plan, I have copied it only once.<\/p>\n<p>Now, result cache is enabled for this session and the same statement is executed two times again.<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\"><code><\/code>SQL&gt; ALTER SESSION SET result_cache_mode = FORCE;\nSession altered.\nSQL&gt; SELECT CUST_CITY, COUNT(*) FROM CUSTOMERS GROUP BY CUST_CITY;\n620 rows selected.\nElapsed: 00:00:00.12\nExecution Plan\n----------------------------------------------------------\nPlan hash value: 1577413243\n--------------------------------------------------------------------------------------------------\n| Id \u00a0| Operation \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 | Name \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 | Rows \u00a0| Bytes | Cost (%CPU)| Time \u00a0 \u00a0 |\n--------------------------------------------------------------------------------------------------\n| \u00a0 0 | SELECT STATEMENT \u00a0 \u00a0| \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0| \u00a0 620 | \u00a06200 | \u00a0 407 \u00a0 (1)| 00:00:05 |\n| \u00a0 1 | \u00a0RESULT CACHE \u00a0 \u00a0 \u00a0 | dg3tccfff51dj1n3932f7wjypt | \u00a0 \u00a0 \u00a0 | \u00a0 \u00a0 \u00a0 | \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0| \u00a0 \u00a0 \u00a0 \u00a0 \u00a0|\n| \u00a0 2 | \u00a0 HASH GROUP BY \u00a0 \u00a0 | \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0| \u00a0 620 | \u00a06200 | \u00a0 407 \u00a0 (1)| 00:00:05 |\n| \u00a0 3 | \u00a0 \u00a0TABLE ACCESS FULL| CUSTOMERS \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0| 55500 | \u00a0 541K| \u00a0 405 \u00a0 (1)| 00:00:05 |\n--------------------------------------------------------------------------------------------------\nResult Cache Information (identified by operation id):\n------------------------------------------------------\n1 - column-count=2; dependencies=(SH.CUSTOMERS); parameters=(nls); name=\"SELECT CUST_CITY, COUNT(*) FROM CUSTOMERS GROUP BY CUST_CITY\"\n\nSQL&gt; SELECT CUST_CITY, COUNT(*) FROM CUSTOMERS GROUP BY CUST_CITY;\n620 rows selected.\nElapsed: 00:00:00.00\nExecution Plan\n----------------------------------------------------------\nPlan hash value: 1577413243\n--------------------------------------------------------------------------------------------------\n| Id \u00a0| Operation \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 | Name \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 | Rows \u00a0| Bytes | Cost (%CPU)| Time \u00a0 \u00a0 |\n--------------------------------------------------------------------------------------------------\n| \u00a0 0 | SELECT STATEMENT \u00a0 \u00a0| \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0| \u00a0 620 | \u00a06200 | \u00a0 407 \u00a0 (1)| 00:00:05 |\n| \u00a0 1 | \u00a0RESULT CACHE \u00a0 \u00a0 \u00a0 | dg3tccfff51dj1n3932f7wjypt | \u00a0 \u00a0 \u00a0 | \u00a0 \u00a0 \u00a0 | \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0| \u00a0 \u00a0 \u00a0 \u00a0 \u00a0|\n| \u00a0 2 | \u00a0 HASH GROUP BY \u00a0 \u00a0 | \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0| \u00a0 620 | \u00a06200 | \u00a0 407 \u00a0 (1)| 00:00:05 |\n| \u00a0 3 | \u00a0 \u00a0TABLE ACCESS FULL| CUSTOMERS \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0| 55500 | \u00a0 541K| \u00a0 405 \u00a0 (1)| 00:00:05 |\n--------------------------------------------------------------------------------------------------\nResult Cache Information (identified by operation id):\n------------------------------------------------------\n1 - column-count=2; dependencies=(SH.CUSTOMERS); parameters=(nls); name=\"SELECT CUST_CITY, COUNT(*) FROM CUSTOMERS GROUP BY CUST_CITY\"<\/pre>\n<p>A new operation named &#8220;RESULT CACHE&#8221; has been added in the execution plan. The two statements share the same name for result cache operation. The first execution is a little more longer than when cache is disabled but the second is immediate. The explanation seems simple, during the first execution Oracle puts the result in cache and for the second execution, the only operation is to read cache.<br \/>\nTo check cache allocation and verify the hypothesis, I check into some result cache views under SYS account.<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\"><code><\/code>SQL&gt; SELECT id, name, cache_id, cache_key, type, status FROM v$result_cache_objects;\n ID NAME \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 CACHE_ID \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 CACHE_KEY \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0TYPE \u00a0 \u00a0 \u00a0 STATUS\n--- ---------------------------------------- ------------------------------ ------------------------------ ---------- ---------\n\u00a0 0 SH.CUSTOMERS \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 SH.CUSTOMERS \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 SH.CUSTOMERS \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Dependency Published\n\u00a0 1 SELECT CUST_CITY, COUNT(*) FROM CUSTOMER dg3tccfff51dj1n3932f7wjypt \u00a0 \u00a0 9mxfx9vgpfzacd7c143887rgg1 \u00a0 \u00a0 Result \u00a0 \u00a0 Published\n\u00a0 \u00a0 S GROUP BY CUST_CITY\n2 objects have been created, a dependency object and a result object and both are published. The result object cache id corresponds to the result cache operation name in execution plan.\n\nSQL&gt; select * from V$RESULT_CACHE_STATISTICS;\n ID \u00a0 \u00a0 \u00a0 \u00a0 NAME \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 VALUE\n---------- ---------------------------------------- ----------\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a01 Block Size (Bytes) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 1024\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a02 Block Count Maximum \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a04096\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a03 Block Count Current \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a032\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a04 Result Size Maximum (Blocks) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 204\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a05 Create Count Success \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 1\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a06 Create Count Failure \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 0\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a07 Find Count \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 1\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a08 Invalidation Count \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 0\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a09 Delete Count Invalid \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 0\n\u00a0 \u00a0 \u00a0 \u00a0 10 Delete Count Valid \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 0\n\u00a0 \u00a0 \u00a0 \u00a0 11 Hash Chain Length \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a01\n\u00a0 \u00a0 \u00a0 \u00a0 12 Find Copy Count \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a00<\/pre>\n<p>&#8220;Create Count Success&#8221; statistic shows that the first query creates the result object in cache and &#8220;Find Count&#8221; shows that the second execution has found and used the result object.<\/p>\n<p>To check how cache reacts when data is changed, I have updated the table customers.<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\"><code><\/code>-- SH session\nSQL&gt; UPDATE CUSTOMERS SET cust_first_name = cust_first_name where rownum = 1;\n1 row updated.\nSQL&gt; commit;\nCommit complete.\n-- SYS session\nSQL&gt; SELECT id, name, cache_id, cache_key, type, status FROM v$result_cache_objects;\n\u00a0ID NAME \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 CACHE_ID \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 CACHE_KEY \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0TYPE \u00a0 \u00a0 \u00a0 STATUS\n--- ---------------------------------------- ------------------------------ ------------------------------ ---------- ---------\n\u00a0 0 SH.CUSTOMERS \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 SH.CUSTOMERS \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 SH.CUSTOMERS \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Dependency Published\n\u00a0 1 SELECT CUST_CITY, COUNT(*) FROM CUSTOMER dg3tccfff51dj1n3932f7wjypt \u00a0 \u00a0 9mxfx9vgpfzacd7c143887rgg1 \u00a0 \u00a0 Result \u00a0 \u00a0 Invalid\n\u00a0 \u00a0 S GROUP BY CUST_CITY<\/pre>\n<p>Result is not deleted from cache, result object became invalid and dependency object is still published. But a counter allows checking the number of invalidations that occurred on a dependency object. In fact, the next time the statement will be executed, the cache will be updated.<\/p>\n<p>I suppose the result set is not deleted because of its location in the shared pool. According to Oracle documentation, in general, any item in the shared pool remains there until it is flushed according to a modified LRU algorithm (see\u00a0<a href=\"http:\/\/docs.oracle.com\/cd\/E11882_01\/server.112\/e25789\/memory.htm#CNCPT007\">Memory Architecture<\/a>).<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">-- The statement 'SELECT CUST_CITY, COUNT(*) FROM CUSTOMERS GROUP BY CUST_CITY' has been executed several times again in two different SH session with result cache\n-- SYS\nSQL&gt; SELECT id, name, cache_id, cache_key, type, status, invalidations FROM v$result_cache_objects;\n ID NAME \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 CACHE_ID \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 CACHE_KEY \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0TYPE \u00a0 \u00a0 \u00a0 STATUS \u00a0 \u00a0INVALIDATIONS\n--- ---------------------------------------- ------------------------------ ------------------------------ ---------- --------- -------------\n\u00a0 0 SH.CUSTOMERS \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 SH.CUSTOMERS \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 SH.CUSTOMERS \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Dependency Published \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 1\n\u00a010 SELECT CUST_CITY, COUNT(*) FROM CUSTOMER dg3tccfff51dj1n3932f7wjypt \u00a0 \u00a0 9mxfx9vgpfzacd7c143887rgg1 \u00a0 \u00a0 Result \u00a0 \u00a0 Published \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 0\n\u00a0 \u00a0 S GROUP BY CUST_CITY\n\u00a0 1 SELECT CUST_CITY, COUNT(*) FROM CUSTOMER dg3tccfff51dj1n3932f7wjypt \u00a0 \u00a0 9mxfx9vgpfzacd7c143887rgg1 \u00a0 \u00a0 Result \u00a0 \u00a0 Invalid \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 0\n\u00a0 \u00a0 S GROUP BY CUST_CITY\nSQL&gt; select * from V$RESULT_CACHE_STATISTICS;\n\u00a0ID NAME \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 VALUE\n--- ---------------------------------------- ----------\n\u00a0 1 Block Size (Bytes) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 1024\n\u00a0 2 Block Count Maximum \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a04096\n\u00a0 3 Block Count Current \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a032\n\u00a0 4 Result Size Maximum (Blocks) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 204\n\u00a0 5 Create Count Success \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 2\n\u00a0 6 Create Count Failure \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 0\n\u00a0 7 Find Count \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 14\n\u00a0 8 Invalidation Count \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 1\n\u00a0 9 Delete Count Invalid \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 0\n\u00a010 Delete Count Valid \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 0\n\u00a011 Hash Chain Length \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a01\n\u00a012 Find Copy Count \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a00<\/pre>\n<p>A new updated result object has been created, a new object is present in v$result_cache_objects and &#8220;Create Count Success&#8221; is increased. Result cache memory can be consumed by invalid results which always need to be refreshed if the table is frequently updated. To check if the cache is efficient, check the ratio between &#8220;Create Count Success&#8221; and &#8220;Find Count&#8221; and the value of &#8220;Invalidation Count&#8221;.<\/p>\n<h3>Result cache with views<\/h3>\n<p>Now, I would like to see result cache behaviour with views. I have created a view with the same statement whose result is already in the cache.<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">-- SH\nSQL&gt; CREATE VIEW customer_cities AS SELECT cust_city, count(*) as total_customers FROM sh.customers GROUP BY cust_city;\nView created.\nSQL&gt; select * from customer_cities;\n620 rows selected.\nElapsed: 00:00:00.02\nExecution Plan\n----------------------------------------------------------\nPlan hash value: 1577413243\n--------------------------------------------------------------------------------------------------\n| Id \u00a0| Operation \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 | Name \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 | Rows \u00a0| Bytes | Cost (%CPU)| Time \u00a0 \u00a0 |\n--------------------------------------------------------------------------------------------------\n| \u00a0 0 | SELECT STATEMENT \u00a0 \u00a0| \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0| \u00a0 620 | \u00a06200 | \u00a0 407 \u00a0 (1)| 00:00:05 |\n| \u00a0 1 | \u00a0RESULT CACHE \u00a0 \u00a0 \u00a0 | 3ysncryjpt7d11yrf9vs04ctmd | \u00a0 \u00a0 \u00a0 | \u00a0 \u00a0 \u00a0 | \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0| \u00a0 \u00a0 \u00a0 \u00a0 \u00a0|\n| \u00a0 2 | \u00a0 HASH GROUP BY \u00a0 \u00a0 | \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0| \u00a0 620 | \u00a06200 | \u00a0 407 \u00a0 (1)| 00:00:05 |\n| \u00a0 3 | \u00a0 \u00a0TABLE ACCESS FULL| CUSTOMERS \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0| 55500 | \u00a0 541K| \u00a0 405 \u00a0 (1)| 00:00:05 |\n--------------------------------------------------------------------------------------------------\n-- SYS\nSQL&gt; SELECT id, name, cache_id, cache_key, type, status, invalidations FROM v$result_cache_objects;\n\u00a0ID NAME \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 CACHE_ID \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 CACHE_KEY \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0TYPE \u00a0 \u00a0 \u00a0 STATUS \u00a0 \u00a0INVALIDATIONS\n--- ---------------------------------------- ------------------------------ ------------------------------ ---------- --------- -------------\n\u00a028 SH.CUSTOMER_CITIES \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 SH.CUSTOMER_CITIES \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 SH.CUSTOMER_CITIES \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Dependency Published \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 0\n\u00a029 select * from customer_cities \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a03ysncryjpt7d11yrf9vs04ctmd \u00a0 \u00a0 3yjy9v421rggpfdpw9b6tvwjky \u00a0 \u00a0 Result \u00a0 \u00a0 Published \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 0<\/pre>\n<p>Oracle did not use the existing result cache although the query is the same. A new result cache and a new dependency object on the view have been created. The new dependency object is the view itself. Is Oracle capable of invalidating the cache if the table customers change?<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">SQL&gt; update sh.customers set cust_gender=upper(cust_gender) where rownum &lt;=1;1 row updated.\nSQL&gt; commit;\nCommit complete.\nSQL&gt; SELECT id, name, cache_id, cache_key, type, status, invalidations FROM v$result_cache_objects;\n\u00a0ID NAME \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 CACHE_ID \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 CACHE_KEY \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0TYPE \u00a0 \u00a0 \u00a0 STATUS \u00a0 \u00a0INVALIDATIONS\n--- ---------------------------------------- ------------------------------ ------------------------------ ---------- --------- -------------\n\u00a028 SH.CUSTOMER_CITIES \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 SH.CUSTOMER_CITIES \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 SH.CUSTOMER_CITIES \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Dependency Published \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 0\n\u00a029 select * from customer_cities \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a03ysncryjpt7d11yrf9vs04ctmd \u00a0 \u00a0 3yjy9v421rggpfdpw9b6tvwjky \u00a0 \u00a0 Result \u00a0 \u00a0 Invalid \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 0<\/pre>\n<p>The result set is now invalid. Oracle associated this result cache with dependency object SH.CUSTOMERS already present in the cache.<\/p>\n<h3>PL\/SQL and binding variable<\/h3>\n<p>To test result cache behaviour within PL\/SQL, I have created a function that returns the full name of a customer passing the customer id. Then I have simulated a program which needs to print out the full name of many customers by looping on this function and I have checked result cache usage.<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">-- SH session\nCREATE OR REPLACE FUNCTION getCustomerName(customer_id number)\nRETURN varchar2\nAS\nfirst_name customers.cust_first_name%TYPE;\nlast_name customers.cust_last_name%TYPE;\nBEGIN\nSELECT cust_first_name, cust_last_name into first_name, last_name FROM customers where cust_id = customer_id;\nRETURN first_name || ', ' || last_name;\nEND;\nSQL&gt; DECLARE\u00a0 2 \u00a0cust_full_name varchar2(80);\n\u00a0 3 \u00a0BEGIN\n\u00a0 4 \u00a0FOR x IN 1500 .. 1999 LOOP\n\u00a0 5 \u00a0cust_full_name:=getCustomerName(x);\n\u00a0 6 \u00a0END LOOP;\n\u00a0 7 \u00a0END;\n\u00a0 8 \u00a0\/\n-- SYS\nID \u00a0NAME \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0CACHE_ID \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 CACHE_KEY \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0TYPE \u00a0 \u00a0 \u00a0 STATUS \u00a0 \u00a0INVALIDATIONS\n--- ---------------------------------------- ------------------------------ ------------------------------ ---------- --------- -------------\n\u00a0xx SELECT CUST_FIRST_NAME, CUST_LAST_NAME F xxxxxxxxxxxxxxxxxxxxxxxxxx \u00a0 \u00a0 xxxxxxxxxxxxxxxxxxxxxxxxxx \u00a0 \u00a0 Result \u00a0 \u00a0 Published \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 0\n\u00a0 \u00a0 ROM CUSTOMERS WHERE CUST_ID = :B1<\/pre>\n<p>We notice two things, PL\/SQL access to the result cache and bind variable has been recognized. The parameter has been replaced in the SQL text but as each result had a different result, logically result cache created a result set for each value of the bind value.<br \/>\nIt seems that in this configuration, result cache can be efficient only if the statement will be re-executed with the same value for the bind variable because the first execution just creates the result object. As the result cache memory is limited, a single execution can replace old result object by new object that may be not used later.<\/p>\n<h3>Conclusion<\/h3>\n<p>Query result cache may be a useful feature for SQL statement on relatively static tables (such as parameter&#8217;s table) or on complex statement consumming time in computing the same data.<\/p>\n<p>But if the &#8220;Created Count Success&#8221; is much larger than &#8220;Find count&#8221;, result cache could not be very efficient, i.e. created objects are not used before being replaced by new objects.<\/p>\n<p>So result cache can be a useful feature, but we need to pay attention on memory consumption and also on which statement offers the best benefit.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Oracle has introduced three new caching features in its Oracle 11g release:<\/p>\n<ul>\n<li>Query result cache<\/li>\n<li>Client OCI result cache<\/li>\n<li>PL\/SQL function result cache<\/li>\n<\/ul>\n<p>In this posting, I will present the query result cache feature.<\/p>\n","protected":false},"author":16,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[197],"tags":[17,67,303],"type_dbi":[],"class_list":["post-2438","post","type-post","status-publish","format-standard","hentry","category-application-integration-middleware","tag-oracle-11g","tag-performance","tag-result-cache"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>&#039;Query result cache&#039; in Oracle 11g - dbi Blog<\/title>\n<meta name=\"description\" content=\"Query result cache may be a useful feature for SQL statement on relatively static tables (such as parameter&#039;s table) or on complex statement consumming time in computing the same data.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/query-result-cache-overview-in-oracle-11g\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"&#039;Query result cache&#039; in Oracle 11g\" \/>\n<meta property=\"og:description\" content=\"Query result cache may be a useful feature for SQL statement on relatively static tables (such as parameter&#039;s table) or on complex statement consumming time in computing the same data.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/query-result-cache-overview-in-oracle-11g\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2012-01-05T19:22:00+00:00\" \/>\n<meta name=\"author\" content=\"Nicolas Jardot\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Nicolas Jardot\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"12 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/query-result-cache-overview-in-oracle-11g\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/query-result-cache-overview-in-oracle-11g\/\"},\"author\":{\"name\":\"Nicolas Jardot\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/0aa30f52275a132e9cc2c387708f84ed\"},\"headline\":\"&#8216;Query result cache&#8217; in Oracle 11g\",\"datePublished\":\"2012-01-05T19:22:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/query-result-cache-overview-in-oracle-11g\/\"},\"wordCount\":1216,\"commentCount\":0,\"keywords\":[\"Oracle 11g\",\"Performance\",\"Result cache\"],\"articleSection\":[\"Application integration &amp; Middleware\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/query-result-cache-overview-in-oracle-11g\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/query-result-cache-overview-in-oracle-11g\/\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/query-result-cache-overview-in-oracle-11g\/\",\"name\":\"'Query result cache' in Oracle 11g - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\"},\"datePublished\":\"2012-01-05T19:22:00+00:00\",\"author\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/0aa30f52275a132e9cc2c387708f84ed\"},\"description\":\"Query result cache may be a useful feature for SQL statement on relatively static tables (such as parameter's table) or on complex statement consumming time in computing the same data.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/query-result-cache-overview-in-oracle-11g\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/query-result-cache-overview-in-oracle-11g\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/query-result-cache-overview-in-oracle-11g\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/www.dbi-services.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"&#8216;Query result cache&#8217; in Oracle 11g\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/0aa30f52275a132e9cc2c387708f84ed\",\"name\":\"Nicolas Jardot\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/112c023c253239221e61a24d59db49d57b354e10da6e7c074cfff50e1b5a6dd8?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/112c023c253239221e61a24d59db49d57b354e10da6e7c074cfff50e1b5a6dd8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/112c023c253239221e61a24d59db49d57b354e10da6e7c074cfff50e1b5a6dd8?s=96&d=mm&r=g\",\"caption\":\"Nicolas Jardot\"},\"description\":\"Nicolas Jardot is a senior consultant with more than nine years of experience in Oracle database infrastructure management and optimization. In addition to standard operations, he is specialized in the performance optimization and tuning of Oracle databases. He also has a strong knowledge of SQL language and has developed several PL\/SQL packages to simplify the administration of database applications. He also maintains the DMK_SQL package of dbi services\u2019 Database Management Kit. Nicolas is Oracle Certified Professional 11g\/12c and Oracle Certified Expert Performance Management and Tuning 12c and holds speeches around Oracle technologies in various conferences including Oracle OpenWorld and UKOUG. Over time, Nicolas has become increasingly interested in Cloud and automation technologies. He has been working for over two years on building and maintaining applications in AWS and operates a CI\/CD pipeline to provision and configure the infrastructure. Nicolas is also certified AWS Solution Architect Professional. Prior to dbi services, Nicolas Jardot was C++ developer on an application virtualization solution, which gave him a solid experience in virtualization and centralization of applications. Nicolas Jardot holds an Engineer\u2019s Degree in Computer Science from the University of Technology of Belfort-Montb\u00e9liard (F). His branch-related experience covers Pharma, Public Sector, Health, Real Estate, Automotive, etc.\",\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/nicolas-jardot-762b9535\/\"],\"url\":\"https:\/\/www.dbi-services.com\/blog\/author\/nicolas-jardot\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"'Query result cache' in Oracle 11g - dbi Blog","description":"Query result cache may be a useful feature for SQL statement on relatively static tables (such as parameter's table) or on complex statement consumming time in computing the same data.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/query-result-cache-overview-in-oracle-11g\/","og_locale":"en_US","og_type":"article","og_title":"'Query result cache' in Oracle 11g","og_description":"Query result cache may be a useful feature for SQL statement on relatively static tables (such as parameter's table) or on complex statement consumming time in computing the same data.","og_url":"https:\/\/www.dbi-services.com\/blog\/query-result-cache-overview-in-oracle-11g\/","og_site_name":"dbi Blog","article_published_time":"2012-01-05T19:22:00+00:00","author":"Nicolas Jardot","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Nicolas Jardot","Est. reading time":"12 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/query-result-cache-overview-in-oracle-11g\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/query-result-cache-overview-in-oracle-11g\/"},"author":{"name":"Nicolas Jardot","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/0aa30f52275a132e9cc2c387708f84ed"},"headline":"&#8216;Query result cache&#8217; in Oracle 11g","datePublished":"2012-01-05T19:22:00+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/query-result-cache-overview-in-oracle-11g\/"},"wordCount":1216,"commentCount":0,"keywords":["Oracle 11g","Performance","Result cache"],"articleSection":["Application integration &amp; Middleware"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/query-result-cache-overview-in-oracle-11g\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/query-result-cache-overview-in-oracle-11g\/","url":"https:\/\/www.dbi-services.com\/blog\/query-result-cache-overview-in-oracle-11g\/","name":"'Query result cache' in Oracle 11g - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"datePublished":"2012-01-05T19:22:00+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/0aa30f52275a132e9cc2c387708f84ed"},"description":"Query result cache may be a useful feature for SQL statement on relatively static tables (such as parameter's table) or on complex statement consumming time in computing the same data.","breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/query-result-cache-overview-in-oracle-11g\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/query-result-cache-overview-in-oracle-11g\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/query-result-cache-overview-in-oracle-11g\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"&#8216;Query result cache&#8217; in Oracle 11g"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/0aa30f52275a132e9cc2c387708f84ed","name":"Nicolas Jardot","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/112c023c253239221e61a24d59db49d57b354e10da6e7c074cfff50e1b5a6dd8?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/112c023c253239221e61a24d59db49d57b354e10da6e7c074cfff50e1b5a6dd8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/112c023c253239221e61a24d59db49d57b354e10da6e7c074cfff50e1b5a6dd8?s=96&d=mm&r=g","caption":"Nicolas Jardot"},"description":"Nicolas Jardot is a senior consultant with more than nine years of experience in Oracle database infrastructure management and optimization. In addition to standard operations, he is specialized in the performance optimization and tuning of Oracle databases. He also has a strong knowledge of SQL language and has developed several PL\/SQL packages to simplify the administration of database applications. He also maintains the DMK_SQL package of dbi services\u2019 Database Management Kit. Nicolas is Oracle Certified Professional 11g\/12c and Oracle Certified Expert Performance Management and Tuning 12c and holds speeches around Oracle technologies in various conferences including Oracle OpenWorld and UKOUG. Over time, Nicolas has become increasingly interested in Cloud and automation technologies. He has been working for over two years on building and maintaining applications in AWS and operates a CI\/CD pipeline to provision and configure the infrastructure. Nicolas is also certified AWS Solution Architect Professional. Prior to dbi services, Nicolas Jardot was C++ developer on an application virtualization solution, which gave him a solid experience in virtualization and centralization of applications. Nicolas Jardot holds an Engineer\u2019s Degree in Computer Science from the University of Technology of Belfort-Montb\u00e9liard (F). His branch-related experience covers Pharma, Public Sector, Health, Real Estate, Automotive, etc.","sameAs":["https:\/\/www.linkedin.com\/in\/nicolas-jardot-762b9535\/"],"url":"https:\/\/www.dbi-services.com\/blog\/author\/nicolas-jardot\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/2438","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=2438"}],"version-history":[{"count":0,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/2438\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=2438"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=2438"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=2438"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=2438"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}