隐含参数_db_block_numa
2017-03-05 15:57
337 查看
SQL> select 2 x.ksppinm name, 3 y.ksppstvl value, 4 y.ksppstdf isdefault, 5 decode(bitand(y.ksppstvf,7),1,'MODIFIED',4,'SYSTEM_MOD','FALSE') ismod, 6 decode(bitand(y.ksppstvf,2),2,'TRUE','FALSE') isadj 7 from 8 sys.x$ksppi x, 9 sys.x$ksppcv y 10 where 11 x.inst_id = userenv('Instance') and 12 y.inst_id = userenv('Instance') and 13 x.indx = y.indx and 14 x.ksppinm like '%_optimizer_skip_scan_enabled%' 15 order by 16 translate(x.ksppinm, ' _', ' '); NAME VALUE ISDEFAULT ISMOD ISADJ ------------------------- ------------------------- --------- ---------- ----- _optimizer_skip_scan_enab TRUE TRUE FALSE FALSE led
当该参数被设置为false时,优化器将不会考虑索引跳跃扫描
# 创建测试表
SQL> create index ind_test on test(object_type,object_id,object_name); Index created. SQL> analyze table test compute statistics for all indexed columns; Table analyzed. SQL> select object_id from test where object_type='INDEX PARTITION' and rownum<2; OBJECT_ID ---------- 5851
# 将参数修改为false
SQL> alter session set "_optimizer_skip_scan_enabled"=false; Session altered.
# 查询指定object_id,执行计划为全表扫描
SQL> select * from test where object_id=5851; Execution Plan ---------------------------------------------------------- Plan hash value: 1357081020 -------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | -------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 1 | 312 | 415 (1)| 00:00:01 | |* 1 | TABLE ACCESS FULL| TEST | 1 | 312 | 415 (1)| 00:00:01 | -------------------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 1 - filter("OBJECT_ID"=5851) Note ----- - dynamic statistics used: dynamic sampling (level=2) Statistics ----------------------------------------------- 4000 ----------- 20 recursive calls 0 db block gets 1622 consistent gets 1566 physical reads 0 redo size 1877 bytes sent via SQL*Net to client 543 bytes received via SQL*Net from client 2 SQL*Net roundtrips to/from client 0 sorts (memory) 0 sorts (disk) 1 rows processed
# 将参数修改为true
SQL> alter session set "_optimizer_skip_scan_enabled"=true; Session altered.
# 当此参数设置为true时,优化器将会估算根本,如果索引跳跃扫描成本更低,将选择索引跳跃扫描的方式来产生执行计划
SQL> select * from test where object_id=5851; Execution Plan ---------------------------------------------------------- Plan hash value: 4219850847 ------------------------------------------------------------------------------------------------ | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | ------------------------------------------------------------------------------------------------ | 0 | SELECT STATEMENT | | 1 | 312 | 47 (0)| 00:00:01 | | 1 | TABLE ACCESS BY INDEX ROWID BATCHED| TEST | 1 | 312 | 47 (0)| 00:00:01 | |* 2 | INDEX SKIP SCAN | IND_TEST | 1 | | 46 (0)| 00:00:01 | ------------------------------------------------------------------------------------------------ Predicate Information (identified by operation id): --------------------------------------------------- 2 - access("OBJECT_ID"=5851) filter("OBJECT_ID"=5851) Note ----- - dynamic statistics used: dynamic sampling (level=2) Statistics ---------------------------------------------------------- 5 recursive calls 0 db block gets 102 consistent gets 31 physical reads 0 redo size 1881 bytes sent via SQL*Net to client 543 bytes received via SQL*Net from client 2 SQL*Net roundtrips to/from client 0 sorts (memory) 0 sorts (disk) 1 rows processed
相关文章推荐
- Oracle db_block_checking和db_block_checksum 两个参数区别
- 一次恢复DB的过程:试用隐含参数_allow_resetlogs_corruption和重建undo tablespace
- 执行计划里recursive calls,db block gets和consistent gets参数的解释
- 执行计划里recursive calls,db block gets和consistent gets参数的解释
- 关于执行计划里recursive calls,db block gets和consistent gets参数的解释
- 跟着吕大师(VAGE)揭密隐含参数:_db_writer_coalesce_area_size
- 关于执行计划里recursivecalls,dbblockgets和consistentgets参数的解释
- 跟着吕大师(VAGE)揭密隐含参数:_db_writer_coalesce_area_size
- Oracle参数“”_db_block_check_objtyp”
- oracle中涉及到的隐含参数的解决办法
- ORACLE隐含参数
- 如何查看ORACLE的隐含参数
- 参数db_ultra_safe
- Block[Table[mnode:2,/opt/resin_push/resin-data/self-service/distcache/mnode.db],1b8002,copy=false,lo
- 【参数】恢复db_recovery_file_dest_size参数为默认值“0”方法
- dbca创建数据库时设置错了db_block_size
- ORACLE 11g 修改db_unique_name参数
- js的隐含参数(arguments,callee,caller)使用方法
- javascript:传递给函数的隐含参数:arguments
- 恢复db_recovery_file_dest_size参数为默认值“0”方法