简体   繁体   中英

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 SQL Server 2005.

  1. The table that undergone Full Table Scan
  2. The query that caused the table to undergo Full Table Scan
  3. Time of Scan
  4. Time taken for completing the scan
  5. Number of records returned by the query
  6. 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?

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).

The following SYS.DM_DB_INDEX_USAGE_STATS should give you most of that. 5 and 6 probably wont be possible though.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM