打印本文 打印本文 关闭窗口 关闭窗口
重建 SQLServer 索引的重要性!
作者:武汉SEO闵涛  文章来源:敏韬网  点击数8610  更新时间:2007/11/14 13:07:47  文章录入:mintao  责任编辑:mintao
同样在Query Analyzer中输入命令:

use northwind

dbcc dbreindex(''''northwind.dbo.orders'''',pk_orders,90)

 

执行结果

 

DBCC execution completed. If DBCC printed error messages, contact your system administrator.

 

Dbcc dbreindex参数说明第一个参数为要重构的表明。第二个参数为需要重构的索引表识,‘’表示所有的索引。第三个参数为页的填充因子,填充因子越大,页越满。

 

然后再用DBCC SHOWCONTIG查看重构簇索引后的结果:

use northwind

declare @table_id int

set @table_id=object_id(''''orders'''')

dbcc showcontig(@table_id)

返回结果如下:

DBCC SHOWCONTIG scanning ''''Orders'''' table...

Table: ''''Orders'''' (21575115); index ID: 1, database ID: 6

 

 

 

TABLE level scan performed.

- Pages Scanned................................: 22

- Extents Scanned..............................: 3

上一页  [1] [2] [3] [4] [5] [6] [7] [8] [9]  下一页

打印本文 打印本文 关闭窗口 关闭窗口