This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Newtonsoft.Json; | |
using Xunit; | |
using Xunit.Abstractions; | |
namespace UnitTest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Reflection; | |
using System.Reflection.Emit; | |
using System.Text; | |
using AspectCore.Extensions.Reflection.Emit; | |
using Xunit; | |
namespace AspectCore.Extensions.Reflection.Test | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Identifying Unused Indexes in SQL Server | |
SELECT OBJECT_NAME(s.[object_id]) AS [Table Name] , | |
i.name AS [Index Name] , | |
i.fill_factor , | |
user_updates AS [Total Writes] , | |
user_seeks + user_scans + user_lookups AS [Total Reads] , | |
user_updates - ( user_seeks + user_scans + user_lookups ) AS [Difference] | |
FROM sys.dm_db_index_usage_stats AS s WITH ( NOLOCK ) | |
INNER JOIN sys.indexes AS i WITH ( NOLOCK ) ON s.[object_id] = i.[object_id] | |
AND i.index_id = s.index_id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT DISTINCT CONVERT(DECIMAL(18, 2) , user_seeks * avg_total_user_cost * ( avg_user_impact * 0.01 )) AS [index_advantage] , | |
migs.last_user_seek , | |
mid.[statement] AS [Database.Schema.Table] , | |
mid.equality_columns , | |
mid.inequality_columns , | |
mid.included_columns , | |
migs.unique_compiles , | |
migs.user_seeks , | |
migs.avg_total_user_cost , | |
migs.avg_user_impact , |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--测式SQL语句: | |
With UIDs As | |
( -- 0 1 2 3 4 5 6 7 8 9 A B C D E F | |
Select 1 AS Id, | |
Cast('00000000000000000000010000000000' As Raw(16)) as "UID" | |
from dual | |
Union | |
Select 2 AS ID, |