一.何时执行update statistics
决定何时执行update statistics可以通过以下三种方式来决定
1.select top 100 * from sysstatistics where id in (select id from sysobjects where name in ('xxx')),通过moddate来判断上次更新统计信息的时间
2.通过机器执行optdiag statistics model.dbo.test -Smy_sybaselinux -Usa -P查看上次更新统计信息时间
3.通过datachange()函数来确定上次更新后现在数据更新比,这个比较靠谱
create table matrix(col1 int, col2 int) go insert into matrix values