zoukankan      html  css  js  c++  java
  • 索引相关语句

    查看索引使用情况

    select 
        s.Name + N'.' + t.name as [Table]
        ,i.name as [Index] 
        ,i.is_unique as [IsUnique]
        ,ius.user_seeks as [Seeks], ius.user_scans as [Scans]
        ,ius.user_lookups as [Lookups]
        ,ius.user_seeks + ius.user_scans + ius.user_lookups as [Reads]
        ,ius.user_updates as [Updates], ius.last_user_seek as [Last Seek]
        ,ius.last_user_scan as [Last Scan], ius.last_user_lookup as [Last Lookup]
        ,ius.last_user_update as [Last Update]
    from 
        sys.tables t with (nolock) join sys.indexes i with (nolock) on
            t.object_id = i.object_id
        join sys.schemas s with (nolock) on 
            t.schema_id = s.schema_id
        left outer join sys.dm_db_index_usage_stats ius on
            ius.database_id = db_id() and
            ius.object_id = i.object_id and 
            ius.index_id = i.index_id
    order by
        s.name, t.name, i.index_id
    option (recompile)
  • 相关阅读:
    微信小程序
    js
    js
    uni
    uni/微信小程序
    uni/微信小程序
    ES6...扩展运算符(数组或类数组对象)
    微信小程序
    微信小程序
    玩转storm
  • 原文地址:https://www.cnblogs.com/wissly/p/10260283.html
Copyright © 2011-2022 走看看