SQL Server - Dynamic Management Views - Full Table Scan
I am trying to find out the Dynamic Management Views that will give the following information for开发者_如何学Go SQL Server 2005.
- The table that undergone Full Table Scan
- The query that caused the table to undergo Full Table Scan
- Time of Scan
- Time taken for completing the scan
- Number of records returned by the query
- Total Number of records in the table at the time of scan.
I tried in some of the DMV articles but could not figure out the required DMV query. If it is impossible to achieve in SQL Server 2005, can you please provide 2008 version of this?
The following SYS.DM_DB_INDEX_USAGE_STATS should give you most of that. 5 and 6 probably wont be possible though.
If anyone sees this - as of SQL Server 2008R2, sys.dm_exec_query_stats
has 4 extra columns which might be of use towards point 5.
total_rows – Total number of rows returned by query
last_rows – Number of the rows return by the last execution of the query
min_rows – Minimum numbers of the rows returned by the query since it is compiled
max_rows – Maximum numbers of the rows returned by the query since it is compiled
(Descriptions taken from here - it says it's new for Denali, but 2008 R2 has them too).
精彩评论