Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我查询 sys.dm_exec_query_stats、sys.dm_tran_locks 或 sys.dm_db_index_physical_stats 等 DMV 时,对繁忙的生产 SQL Server 2008 是否有任何性能影响?
谢谢
每一个都有不同的影响。影响取决于返回了多少条目(这通常意味着必须遍历多少内部数据结构),并且某些 DMv 本质上比其他 DMv 对性能更敏感(例如,仅仅因为锁数据结构太多sys.dm_tran_locks就会产生更大的影响sys.dm_exec_query_stats比查询缓存更热)。一些 DMv 之类sys.dm_db_index_physical_stats的隐含磁盘数据扫描,它们将非常昂贵,与全表扫描相当。
sys.dm_tran_locks
sys.dm_exec_query_stats
sys.dm_db_index_physical_stats