为什么有时Update Statistics后SYSTABLE中UPD_STS_TIME的值不变?

~ 0 min
2017-01-18 10:17

有几个原因会导致“update statistics”不会被执行或者执行之后UPD_STS_TIME的值不变,比如:在将DB从5.1移植到5.3之后,然后执行了update statistics 和 rebuild index,假如你再次执行update statistics,索引的统计信息将不会改变.

 

下面是我们列出会影响"update statistics"的行为:

-----------------

1. 新表并且从来没有执行过"update statistics".

2. 表的记录少于20个页.

3. 新增的记录多余两个页.

4. 上次执行"update statistics"超过了10天.

5. 假如对一个表执行"update statistics"是碰到以上1/2/3/4,这个表的索引的统计信息将会被改变.

我们支持了一个新的SQL语法来强行执行"update statistics",方法如下.

>update statistics all; //[sample=100 by default]

>update statistics all sample=60;

版本: 5.3.3, 5.4.1

产品: Normal/Bundle

平台: Windows/Linux

平均分: 0 (0 投票)

你不能对该内容发表评论

标签