摘要:
set nocount ongo--无效索引排序select top 20 db_name() as db_name ,schema_name(o.schema_id) as schema_name ,o.name as object_name ,i.name as index_name,i.is_unique_constraint,(case i.index_id when 1 then 'is_clustered' else '' end) as is_clustered ,ir.rowcnt ,s.user_updates ,(s.user_lo...
阅读全文
摘要:
set nocount onprint db_name()declare @tab_name sysnameset @tab_name='wfpuser_a0113'--内部碎片select '【内部】碎片' as frag_type ,ob.name as object_name ,ix.index_id,ix.name as index_name ,ps.index_level ,ps.partition_number ,ps.record_count ,ps.page_count ,ps.fragment_count ,str(ps.avg...
阅读全文
摘要:
set nocount ongoselect DB_NAME() as db_name ,d.name as object_name ,e.rowcnt ,str(c.avg_total_user_cost*(c.user_scans+c.user_seeks),16,0) as total_user_cost --总成本 ,str(c.avg_total_user_cost,16,0) as avg_total_user_cost --平均成本 ,c.avg_user_impact --平均收益(%) --,c.user_scans --受益 的 sca...
阅读全文