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
;WITH task_space_usage AS ( | |
-- SUM alloc/delloc pages | |
SELECT session_id, | |
request_id, | |
SUM(internal_objects_alloc_page_count) AS alloc_pages, | |
SUM(internal_objects_dealloc_page_count) AS dealloc_pages | |
FROM sys.dm_db_task_space_usage WITH (NOLOCK) | |
WHERE session_id <> @@SPID | |
GROUP BY session_id, request_id | |
) |
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
{ | |
"editor.largeFileOptimizations": false, | |
"editor.detectIndentation": true, | |
"editor.insertSpaces": true, | |
"editor.minimap.enabled": false, | |
"editor.rulers": [80,120], | |
"editor.scrollBeyondLastLine": false, | |
"editor.tabSize": 4, | |
"explorer.autoReveal": true, | |
"explorer.confirmDelete": false, |
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 | |
SELECT | |
r.session_id,r.command,CONVERT(NUMERIC(6,2),r.percent_complete) AS [Percent Complete], | |
CONVERT(VARCHAR(20),DATEADD(ms,r.estimated_completion_time,GetDate()),20) AS [ETA Completion Time], | |
CONVERT(NUMERIC(10,2),r.total_elapsed_time/1000.0/60.0) AS [Elapsed Min], | |
CONVERT(NUMERIC(10,2),r.estimated_completion_time/1000.0/60.0) AS [ETA Min], | |
CONVERT(NUMERIC(10,2),r.estimated_completion_time/1000.0/60.0/60.0) AS [ETA Hours], | |
CONVERT( | |
VARCHAR(1000), |
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
with indexcols as ( | |
select | |
object_id as table_id, | |
index_id, | |
name as index_name, | |
( | |
select case keyno when 0 then null else colid end as [data()] | |
from sys.sysindexkeys as k | |
where k.id = i.object_id | |
and k.indid = i.index_id |
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 @i float = 0.5 | |
select *, (rn_user_scans + rn_user_seeks + rn_user_updates)/3 t | |
from ( | |
SELECT | |
i.name, | |
sts.last_user_seek, | |
sts.last_user_scan, | |
percent_rank() over (order by sts.user_scans) rn_user_scans, | |
sts.user_scans, |
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 | |
id.[statement] | |
,id.[equality_columns] | |
,id.[inequality_columns] | |
,id.[included_columns] | |
,gs.[unique_compiles] AS [UniqueCompiles] | |
,gs.[user_seeks] AS [UserSeeks] | |
,gs.[avg_total_user_cost] AS [AvgTotalUserCost] | |
,gs.[avg_user_impact] AS [AvgUserImpact] | |
,gs.[user_seeks] * gs.[avg_total_user_cost] * (gs.[avg_user_impact] * 0.01) AS [IndexAdvantage] |
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
--DBCC FREEPROCCACHE | |
--PERFORMANCE DE TODAS AS CONSULTAS EXECUTADAS | |
select * | |
from ( | |
select | |
db_name(qt.dbid) db, | |
object_schema_name(qt.objectid, qt.dbid) + '.' + object_name(qt.objectid, qt.dbid) as db_name, | |
substring( | |
qt.text, |
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
for k in $(git branch --sort=committerdate --remote | grep -o -P "(?<=origin\/)[^ ]+"); do | |
if [[ ! $(git log -1 --since='6 month ago' -s origin/$k) ]]; then | |
git push origin -d $k; | |
fi; | |
done; |
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
const childProcess = require("child_process"); | |
const pjson = require('./package.json'); | |
const getDependencies = () => { | |
const response = []; | |
const { dependencies } = pjson; | |
console.log(dependencies) | |
if (!dependencies) { | |
console.log("Package.json without dependencies."); | |
return; |