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.

CHAPTER 4 ■ PERFORMANCE MANAGEMENT 181Note that we provided the optional q_name parameter within the result_cache hint tospecify a name (Query1) for our new SQL query whose results the database will store in theserver result cache. If you check the execution plan for the new SQL query, you’ll see that thequery uses the result_cache optimizer hint:SQL> explain plan forselect /*+ result_cache q_name(Query1) */last_name,salaryfrom hr.employeesorder by salary;Explained.SQL> @$ORACLE_HOME/rdbms/admin/utlxplsPLAN_TABLE_OUTPUT--------------------------------------------------------------------------------Plan hash value: 3447538987--------------------------------------------------------------------------------| Id | Operation | Name | Rows | Bytes | Cost(%CPU)| Time |PLAN_TABLE_OUTPUT-----------------------------------------------------------------------| 0 | SELECT STATEMENT | | 107 | 1284 | 4 (25)| 00:00:01 || 1 | RESULT CACHE | 6xt7gzhawg9jg8m503j2njzdxm | | || || 2 | SORT ORDER BY | | 107 | 1284 | 4 (25)| 00:00:01 || 3 | TABLE ACCESS FULL| EMPLOYEES | 107 | 1284 | 3 (0)| 00:00:01 |PLAN_TABLE_OUTPUT--------------------------------------------------------------------------------Result Cache Information (identified by operation id):------------------------------------------------------1 - column-count=2; dependencies=(HR.EMPLOYEES);name="select /*+ result_cache q_name(Q1) */last_name,salary

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

Saved successfully!

Ooh no, something went wrong!