This file contains hidden or 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; | |
namespace SimpleSavePocoEntities | |
{ | |
public class UserDao | |
{ | |
public int UserKey { get; set; } | |
public Guid UserGuid { get; set; } | |
public int EmployeeId { get; set; } |
This file contains hidden or 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
MIT License | |
Copyright (c) 2015, 2016 Bart Read, arcade.ly (https://arcade.ly), and | |
bartread.com Ltd (http://www.bartread.com/) | |
Permission is hereby granted, free of charge, to any person obtaining a copy of | |
this software and associated documentation files (the "Software"), to deal in the | |
Software without restriction, including without limitation the rights to use, | |
copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the | |
Software, and to permit persons to whom the Software is furnished to do so, |
This file contains hidden or 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
function createParticle( | |
definitionName, | |
position, | |
velocity) { | |
var definition = descriptors[definitionName]; | |
if (definition === undefined) { | |
return undefined; | |
} | |
var particle = { |
This file contains hidden or 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
SET STATISTICS IO ON; | |
GO | |
SELECT blah ... | |
GO | |
SET STATISTICS IO OFF; | |
GO |
This file contains hidden or 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
SET STATISTICS TIME ON; | |
GO | |
SELECT blah ... | |
GO | |
SET STATISTICS TIME OFF; | |
GO |
This file contains hidden or 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
USE [YOUR_DATABASE_NAME]; -- Substitute for your database name | |
GO | |
SELECT TOP 10 | |
t.text , | |
execution_count , | |
statement_start_offset AS stmt_start_offset , | |
s.sql_handle , | |
s.plan_handle , | |
s.total_worker_time / 1000 AS total_cpu_time_millis, |
This file contains hidden or 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
USE master; | |
GO | |
SELECT * FROM sys.dm_exec_query_plan (YOUR_PLAN_HANDLE_HERE); | |
GO |
This file contains hidden or 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 TOP 5 total_worker_time/execution_count AS [Avg CPU Time], | |
Plan_handle, query_plan | |
FROM sys.dm_exec_query_stats AS qs | |
CROSS APPLY sys.dm_exec_query_plan(qs.plan_handle) | |
ORDER BY total_worker_time/execution_count DESC; | |
GO |
This file contains hidden or 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
--get most used tables | |
SELECT | |
db_name(ius.database_id) AS DatabaseName, | |
t.NAME AS TableName, | |
SUM(ius.user_seeks + ius.user_scans + ius.user_lookups) AS NbrTimesAccessed | |
FROM sys.dm_db_index_usage_stats ius | |
INNER JOIN sys.tables t ON t.OBJECT_ID = ius.object_id | |
WHERE database_id = DB_ID('YOUR_DATABASE_HERE') | |
GROUP BY database_id, t.name | |
ORDER BY SUM(ius.user_seeks + ius.user_scans + ius.user_lookups) DESC |
This file contains hidden or 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
declare @dbid int | |
–To get Datbase ID | |
set @dbid = db_id() | |
select | |
db_name(d.database_id) database_name | |
,object_name(d.object_id) object_name | |
,s.name index_name, | |
c.index_columns | |
,d.* |
OlderNewer