??λ??SQL Server??????????
???????????? ???????[ 2012/12/25 10:00:59 ] ????????
????????
???????????????洢??????????????????????????????????????????????????????????Щ?????????????Щ?б????????????????????????????洢??????棬????????????????????α???ú????????????????????θ???????????????ü????????????????inserts??updates??deletes??selects????
?????????????
??????SQLServer?У?????μ?DMVs?????????????Щ?????汾?в?????????????????????????o?????????????????????????????
????Sys.dm_db_index_operational_stats??sys.dm_db_index_usage_stats
????Sys.dm_db_index_operational_stats??
?????ú?????????insert/update/delete????????????????????????????????????????????????????????????????????????У?????????????漸?У?
?????? leaf_insert_count –??????????????
?????? leaf_delete_count -???????????????
?????? leaf_update_count -????????μ?????
??????????????????Щ??????????????????????????????У?
SELECT OBJECT_NAME(A.[OBJECT_ID]) AS [OBJECT NAME]??
I.[NAME] AS [INDEX NAME]??
A.LEAF_INSERT_COUNT??
A.LEAF_UPDATE_COUNT??
A.LEAF_DELETE_COUNT
FROM SYS.DM_DB_INDEX_OPERATIONAL_STATS (NULL??NULL??NULL??NULL ) A
INNER JOIN SYS.INDEXES AS I
ON I.[OBJECT_ID] = A.[OBJECT_ID]
AND I.INDEX_ID = A.INDEX_ID
WHERE OBJECTPROPERTY(A.[OBJECT_ID]??'IsUserTable') = 1
????????????????????????????У???????????ж???insert/update/delete???????????????????????
????????????????????????????????????????????????????????????????
?????? user_seeks – ??????????????
?????? user_scans- ?????????????
?????? user_lookups – ?????????????
?????? user_updates – ???????????????
SELECT OBJECT_NAME(S.[OBJECT_ID]) AS [OBJECT NAME]??
I.[NAME] AS [INDEX NAME]??
USER_SEEKS??
USER_SCANS??
USER_LOOKUPS??
USER_UPDATES
FROM SYS.DM_DB_INDEX_USAGE_STATS AS S
INNER JOIN SYS.INDEXES AS I
ON I.[OBJECT_ID] = S.[OBJECT_ID]
AND I.INDEX_ID = S.INDEX_ID
WHERE OBJECTPROPERTY(S.[OBJECT_ID]??'IsUserTable') = 1
??????????????????????????п??????ж?????????衢???????????????????
???????
??????SQLServer???????Щ???????????sys.dm_db_index_operational_stats??????????????????????heap??????????????????????Ч??
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11