Figure out which databases involve most of the I/O
2010-06-25 17:10
295 查看
WITH Waits AS ( SELECT wait_type, wait_time_ms / 1000. AS wait_time_s, 100. * wait_time_ms / SUM(wait_time_ms) OVER() AS pct, ROW_NUMBER() OVER(ORDER BY wait_time_ms DESC) AS rn FROM sys.dm_os_wait_stats WHERE wait_type NOT LIKE '%SLEEP%' -- filter out additional irrelevant waits ) SELECT W1.wait_type, CAST(W1.wait_time_s AS DECIMAL(12, 2)) AS wait_time_s, CAST(W1.pct AS DECIMAL(12, 2)) AS pct, CAST(SUM(W2.pct) AS DECIMAL(12, 2)) AS running_pct FROM Waits AS W1 JOIN Waits AS W2 ON W2.rn <= W1.rn GROUP BY W1.rn, W1.wait_type, W1.wait_time_s, W1.pct HAVING W1.rn<11 ORDER BY W1.rn;
There is the wait_type description in http://technet.microsoft.com/zh-cn/ms179984(SQL.90).aspx。 But it's too simple to understand, I need more detail information about dm_os_wait_stats。
相关文章推荐
- Ex2010-03 figure out the number of mailboxes per database
- Getting the most out of your pixels - adapting to view state changes(WIN8下设计适应多种分辨率的APP)[转.原]
- Getting the most out of IDispatch(XYDispDriver)
- 4.Your test database is running in NOARCHIVELOG mode. Which statement is true regarding the type of
- Photoshop CS2 RAW : Using Adobe Camera Raw, Bridge, and Photoshop to Get the Most out of Your Digita
- 21.Which three statements are true about logical structures of the Oracle database? (Choose three.)
- a very good guide to makethe Most Out of the SQL Server 2005 Performance Dashboard
- Failed to connect to database. This release of the GeoDatabase is either invalid or out of date
- Hacking Vim: A Cookbook to get the Most out of the Latest Vim Editor
- 102 For which two database objects can the VERSIONS clause of the Flashback Versions Query be used?
- Share a peice of movie script from Rocky Ⅵ which I love the most.
- 3 Getting the Most Out of Everyday Tools
- Seven effective ways to get the most out of the morning
- Ready to make the most of out of your amazing iPad?
- 053-16 Which statement most accurately describes the implementation of a SQL Access Advisor recommen
- Fixed the issue: alias database /etc/mail/aliases.db out of date
- 16 Which statement most accurately describes the implementation of a SQL Access Advisor recommendati
- Database and Mailbox, which is the most crucial asset
- Tweaking your system to get the most out of BitTorrent
- 12.Which is the correct description of a pinned buffer in the database buffer cache?