sql server数据库重建索引的方法
查看是否需要重建索引:
use sales_history
declare @table_id int
set @table_id=object_id('sales_history.dbo.tt_sales_operation')
dbcc showcontig(@table_id)
--结果中有一下信息
--扫描密度[最佳值:实际值]....................: 94.23%[16573:17588]
--如果以上信息中不是100%则需要重新建立索引
use sales_history
dbcc dbreindex('sales_history.dbo.tt_sales_operation','',90)
没有评论:
发表评论