久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

Sql server 表使用情況統計

Sql server table usage statistics(Sql server 表使用情況統計)
本文介紹了Sql server 表使用情況統計的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我想找出數據庫中哪些表使用最頻繁(我的意思是讀/寫字節/表大小比率)或 IO/表大小比率.決定將哪些表放在較快的磁盤上,哪些放在較慢的磁盤上.有什么想法嗎?

I want to find out which tables in the database are most heavily used (I mean read/write Bytes/Table Size ratio) or IO / Table size ratio. To decide which tables to place on faster discs and which on slower ones. Any ideas?

我嘗試使用 dm_db_index_usage_stats
但是如何找出單次搜索/掃描下有多少IO?

I tried make use of dm_db_index_usage_stats
But how to find out how many IO are under single seek/scan?

提前致謝.

推薦答案

Select object_schema_name(UStat.object_id) 
        + '.' + object_name(UStat.object_id) As [Object Name] 
    ,Case
        When Sum(User_Updates + User_Seeks + User_Scans + User_Lookups) = 0 Then Null
        Else Cast(Sum(User_Seeks + User_Scans + User_Lookups) As Decimal)
                    / Cast(Sum(User_Updates 
                                + User_Seeks 
                                + User_Scans
                                + User_Lookups) As Decimal(19,2))
        End As [Proportion of Reads] 
    , Case
        When Sum(User_Updates + User_Seeks + User_Scans + User_Lookups) = 0 Then Null
        Else Cast(Sum(User_Updates) As Decimal)
                / Cast(Sum(User_Updates 
                            + User_Seeks 
                            + User_Scans
                            + User_Lookups) As Decimal(19,2))
        End As [Proportion Of Writes] 
    , Sum(User_Seeks + User_Scans + User_Lookups) As [Total Read Ops] 
    , Sum(User_Updates) As [Total Write Ops]
From sys.dm_db_Index_Usage_Stats As UStat
    Join Sys.Indexes As I 
        On UStat.object_id = I.object_id
            And UStat.index_Id = I.index_Id
    Join sys.tables As T
        On T.object_id = UStat.object_id
Where I.Type_Desc In ( 'Clustered', 'Heap' )
Group By UStat.object_id
Order By object_schema_name(UStat.object_id) 
        + '.' + object_name(UStat.object_id)

順便說一句,需要檢查的是免費的 Red-Gate 腳本管理器,它有一系列用于診斷信息的 SQL 腳本(不,我不為它們工作).

Btw, something to check out is free Red-Gate's Script Manager which has a series of SQL scripts for diagnostic information (no I do not work for them).

SQL 腳本管理器

這篇關于Sql server 表使用情況統計的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Relative path in t sql?(t sql中的相對路徑?)
Getting the last record in SQL in WHERE condition(在 WHERE 條件下獲取 SQL 中的最后一條記錄)
Query to get XML output for hierarchical data using FOR XML PATH in SQL Server(在 SQL Server 中使用 FOR XML PATH 查詢以獲取分層數據的 XML 輸出)
T-SQL IF statement embedded in a sum() function(嵌入在 sum() 函數中的 T-SQL IF 語句)
Table vs Temp Table Performance(表與臨時表性能)
Can#39;t see created tables in Object Explorer - Microsoft SQL Management Studio(在對象資源管理器中看不到創建的表 - Microsoft SQL Management Studio)
主站蜘蛛池模板: 福利社午夜影院 | 日日摸日日添日日躁av | 午夜码电影 | 成人在线视频免费播放 | 欧美激情一区二区三区 | 久久亚洲经典 | 欧美人妖网站 | 男人天堂手机在线视频 | 国产高清在线观看 | 精品一区二区三区在线观看 | www.日韩免费| av天天看| www.色.com | 国产激情在线 | 一区二区三区四区在线视频 | 成人av电影在线 | 午夜精品在线 | 91精品国产一二三 | 亚洲最新网址 | 亚洲一区视频在线 | 久久久成人免费一区二区 | 狠狠婷婷综合久久久久久妖精 | 美美女高清毛片视频免费观看 | 91欧美精品成人综合在线观看 | 欧美一区二区三区四区视频 | 国产成人免费视频网站视频社区 | 在线亚洲免费视频 | 一级片在线观看 | 久久精品中文字幕 | 亚洲欧美一区二区三区在线 | 国产精品一卡二卡三卡 | 成人一区二区三区在线观看 | 视频一区欧美 | 欧美精品一区二区在线观看 | 欧美一区二区三区在线 | 在线欧美小视频 | 亚洲精品av在线 | 国产成人福利 | 九九精品网 | 精品欧美| 人人人人干 |