11g 新特性之--Query cache result.docx
文本预览下载声明
Oracle 11g 新特性之---Query Cache Result该特性是11gR1引入的,关于query result cache特性,主要有2种:1. PL/SQL Function Result Cache --针对plsql而言 2. Query Result Cache --顾名思义针对重复执行的sql我们都知道oracle通常是通过参数来进行控制某个功能的,当然这个也不例外,首先我们来介绍跟该特性有关的几个参数(包括隐含参数):SQL select * from v$version where rownum 2;BANNER-----------------------------------------------------------------------------Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - ProductionSQL show parameter resultNAME TYPE VALUE------------------------------------ ----------- -----_client_result_cache_bypass boolean FALSE_result_cache_auto_execution_threshold integer 1 _result_cache_auto_size_threshold integer 100_result_cache_auto_time_distance integer 300_result_cache_auto_time_threshold integer 1000_result_cache_block_size integer 1024_result_cache_global boolean TRUE_result_cache_timeout integer 10_xsolapi_sql_result_set_cache_size integer 32client_result_cache_lag big integer 3000client_result_cache_size big integer 0result_cache_max_result integer 5result_cache_max_size big integer 960Kresult_cache_mode string MANUALresult_cache_remote_expiration integer 0几个重要的参数:result_cache_mode该参数是最为重要的,其属性有manual和force 两种。manual是默认属性,也就是说我们要启用该特性,那么必须通过hint来实现,不然oracle的优化器是无法认知的,那么是什么hint呢? 如下:SQL select name,version from v$sql_hint 2 where name like %RESULT%NAME VERSION---------------------------------------- -------------------------RESULT_CACHE 11.1.0.6NO_RESULT_CACHE 11.1.0.6当设置为force时,oracle 优化就能自动识别了,不需要使用hint,相反,如果当设置为force时,同时你又不想某个sql或应用使用该特性,那么可以使用NO_RESUIT_CACHE hint来进行避规。该参数其实还可以设置为auto,不过文档中未提及。至于说,当启动该特性时,oracle是如何来实现的?这个问题需要
显示全部