Monthly: 九月 2015

查询用于检测从来没有被使用过的索引。

admin | MYSQL, 其他技术 | 2015-09-29
–此查询用于检测从来没有被使用过的索引。 select OBJECT_NAME(i.[object_id]) as [Table Name] , i.name from sys.indexes as i inner join sys.objects as o ON i.[object_id] = o.[object_id] where i.index_id not in ( select ddius.index_id from sys.dm_db_index_usage_stats as ddius where ddius.[object_id] = i.[... [阅读全文]
ė 6没有评论 0

–需要维护但是从未被用过的索引

admin | MYSQL, 其他技术 | 2015-09-29
–需要维护但是从未被用过的索引 select ‘[' + DB_NAME () + '].[' + su.[name] + ‘].[' + o.[name] +’]’ as [statement] , i.[name] as [index_name] , ddius.[user_seeks] + ddius.[user_scans] + ddius.[user_lookups] as [user_reads], ddius.[user_updates] as [user_writes] , sum(SP.rows) as [total_rows... [阅读全文]
ė 6没有评论 0

–可能不高效的非聚集索引 (writes > reads)

admin | 其他技术 | 2015-09-29
–可能不高效的非聚集索引 (writes > reads) select OBJECT_NAME(ddius.[object_id]) as [Table Name], i.name AS [Index Name] , i.index_id, user_updates as [Total Writes] , [user_seeks] + [user_scans] + [user_lookups] as [Total Reads], [user_updates] – ([user_seeks] + [user_scans] + [user_lookups]) as [DIffer... [阅读全文]
ė 6没有评论 0
Ɣ回顶部