dbdao吧 关注:1,183贴子:4,074
  • 1回复贴,共1

V$SEGSTAT_NAME中SAMPLED的含义

只看楼主收藏回复

DB 版本11.2.0.4 V$SEGSTAT_NAME中的sampled文档描述是Indicates whether the statistic was collected by sampling (YES) or not (NO);
这里的sampleing是指什么操作呢?如果sampled是NO那么是什么情况下statistics才不会被收集到呢
select sampled from v$segstat_name where name ='row lock waits';
结果为:NO
测试row lock waits:
create table LOCK_TEST
(
COL1 VARCHAR2(10)
);
开启session 1:
insert into lock_test values('BRAIN');
commit;
update lock_test set col1='test';
在session 2 中查询:
select value
from V$SEGMENT_STATISTICS
where object_name = 'LOCK_TEST'
and owner = 'SCOTT'
and statistic_name = 'row lock waits';
1
在session 3中
update lock_test set col1='test';
此时再次在session 2中查询:
SQL> select value
2 from V$SEGMENT_STATISTICS
3 where object_name = 'LOCK_TEST'
4 and owner = 'SCOTT'
5 and statistic_name = 'row lock waits';
VALUE
----------
2
在这种情况下还是在记录此统计信息


1楼2016-03-11 13:39回复
    印象中 从10g开始 v$segstat_name 已经处于没有用的状态了


    2楼2016-03-11 15:16
    回复