For the parameter Optimizer_index_cost_adj

本文探讨了Oracle数据库中Optimizer_index_cost_adj参数的重要性及其对系统性能的影响。通过调整该参数至更合适的值(如10到30之间),可以显著提高某些OLTP系统的性能表现。文章还提供了一种确定最佳参数值的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

For the parameter Optimizer_index_cost_adj I find it  is the most important parameter of all the other parameters, and the default setting of 100 is incorrect for most Oracle systems.
From the Internet I got to know:for some OLTP systems, re-setting this parameter to a smaller value (between 10- to 30) may result in huge performance gains!
And
The parameter can be set from 1 to 10000,
The default is 100.
There is a formula to express Optimizer_index_cost_adj;
Optimizer_index_cost_adj*(index scan cost)==Full Scan cost.
I have tested it in my way .
I got the way to find best value should be set for Optimizer_index_cost_adj.

col c1 heading 'Average Waits for|Full Scan Read I/O' format 9999.999
col c2 heading 'Average Waits for|Index Read I/O' format 9999.999
col c3 heading 'Percent of| I/O Waits|for scattered|Full Scans' format 999.999
col c4 heading 'Percent of| I/O Waits|for sequential|Index Scans' format 999.999
col c5 heading 'Starting|Value|for|optimizer|index|cost|adj' format 999
select
   sum(a.time_waited_micro)/sum(a.total_waits)/1000000 c1,
   sum(b.time_waited_micro)/sum(b.total_waits)/1000000 c2,
   (
      sum(a.total_waits) /
      sum(a.total_waits + b.total_waits)
   ) * 100 c3,
   (
      sum(b.total_waits) /
      sum(a.total_waits + b.total_waits)
   ) * 100 c4,
  (
      sum(b.time_waited_micro) /
      sum(b.total_waits)) /
      (sum(a.time_waited_micro)/sum(a.total_waits)
   ) * 100 c5
from
   dba_hist_system_event a,
   dba_hist_system_event b
where
   a.snap_id = b.snap_id
and
   a.event_name = 'db file scattered read'
and
   b.event_name = 'db file sequential read';

                                                                   Starting
                                                                      Value
                                                                        for
                                        Percent of     Percent of optimizer
                                         I/O Waits      I/O Waits     index
 Average Waits for Average Waits for for scattered for sequential      cost
Full Scan Read I/O    Index Read I/O    Full Scans    Index Scans       adj
------------------ ----------------- ------------- -------------- ---------
              .011              .005        56.452         43.548        41

Luckily ,The parameter can be modified without restart database.

 select isses_modifiable,issys_modifiable
  from v$parameter
 where name='optimizer_index_cost_adj';

ISSES ISSYS_MOD
----- ---------
TRUE  IMMEDIATE

I wish ORACLE could provide more decent default value for it:)))
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值