Skip to content

Commit

Permalink
more changes for #288, initial changes for #292
Browse files Browse the repository at this point in the history
  • Loading branch information
VladDBA committed Dec 23, 2024
1 parent 42c8943 commit c9676bf
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
9 changes: 5 additions & 4 deletions PSBlitz.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4016,13 +4016,14 @@ $JumpToTop
"Serial Required Memory", "Total CPU (ms)", "Avg CPU (ms)", "CPU Weight", "% CPU (Type)",
"Total Duration (ms)", "Avg Duration (ms)", "Duration Weight", "% Duration (Type)",
"Total Reads", "Average Reads", "Read Weight", "% Reads (Type)", "Total Writes",
"Average Writes", "Write Weight", "% Writes (Type)", "Total Rows", "Avg Rows", "Min Rows",
"Max Rows", "# Plans", "# Distinct Plans", "Created At", "Last Execution","Last Completion",
"Average Writes", "Write Weight", "% Writes (Type)", "Total Rows", "Avg Rows", "Min Rows","Max Rows",
"Minimum Memory Grant KB","Maximum Memory Grant KB", "Minimum Used Grant KB", "Maximum Used Grant KB",
"Average Max Memory Grant", "Min Spills", "Max Spills", "Total Spills", "Avg Spills",
"# Plans", "# Distinct Plans", "Created At", "Last Execution","Last Completion",
"Query Hash", "Query Plan Hash",
"SET Options", "Cached Plan Size (KB)", "Compile Time (ms)", "Compile CPU (ms)",
"Compile memory (KB)""Minimum Memory Grant KB",
"Maximum Memory Grant KB", "Minimum Used Grant KB", "Maximum Used Grant KB",
"Average Max Memory Grant", "Min Spills", "Max Spills", "Total Spills", "Avg Spills",

"Remove Plan Handle From Cache","Remove SQL Handle From Cache")
if ($DebugInfo) {
Write-Host " ->Writing sp_BlitzCache results to sheet $SheetName" -fore yellow
Expand Down
Binary file modified Resources/PSBlitzOutput.xlsx
Binary file not shown.
23 changes: 12 additions & 11 deletions Resources/spBlitzCache_NonSPLatest.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4918,8 +4918,8 @@ BEGIN
SET @columns = N' DatabaseName AS [Database],
QueryPlanCost AS [Cost],
CAST('''' AS VARCHAR(30)) AS [Query],
CAST('''' AS VARCHAR(30)) AS [SQLPlan File],
QueryText AS [Query Text],
QueryText AS [Query Text],
CAST('''' AS VARCHAR(30)) AS [SQLPlan File],
QueryType AS [Query Type],
Warnings AS [Warnings],
QueryPlan AS [Query Plan],
Expand Down Expand Up @@ -5028,14 +5028,7 @@ BEGIN
CONVERT(NVARCHAR(30), CAST((AverageReturnedRows) AS BIGINT), 1) AS [Avg Rows],
CONVERT(NVARCHAR(30), CAST((MinReturnedRows) AS BIGINT), 1) AS [Min Rows],
CONVERT(NVARCHAR(30), CAST((MaxReturnedRows) AS BIGINT), 1) AS [Max Rows],
CONVERT(NVARCHAR(30), CAST((NumberOfPlans) AS BIGINT), 1) AS [# Plans],
CONVERT(NVARCHAR(30), CAST((NumberOfDistinctPlans) AS BIGINT), 1) AS [# Distinct Plans],
CONVERT(VARCHAR(25),PlanCreationTime,120) AS [Created At],
CONVERT(VARCHAR(25),LastExecutionTime,120) AS [Last Execution],
CONVERT(VARCHAR(25),LastCompletionTime,120) AS [Last Completion],
CONVERT(VARCHAR(256),QueryHash,1) AS [Query Hash],
CONVERT(VARCHAR(256),QueryPlanHash,1) AS [Query Plan Hash],
COALESCE(SetOptions, '''') AS [SET Options],
CONVERT(NVARCHAR(30), CAST((MinGrantKB) AS BIGINT), 1) AS [Minimum Memory Grant KB],
CONVERT(NVARCHAR(30), CAST((MaxGrantKB) AS BIGINT), 1) AS [Maximum Memory Grant KB],
CONVERT(NVARCHAR(30), CAST((MinUsedGrantKB) AS BIGINT), 1) AS [Minimum Used Grant KB],
Expand All @@ -5044,7 +5037,15 @@ BEGIN
CONVERT(NVARCHAR(30), CAST((MinSpills) AS BIGINT), 1) AS [Min Spills],
CONVERT(NVARCHAR(30), CAST((MaxSpills) AS BIGINT), 1) AS [Max Spills],
CONVERT(NVARCHAR(30), CAST((TotalSpills) AS BIGINT), 1) AS [Total Spills],
CONVERT(NVARCHAR(30), CAST((AvgSpills) AS MONEY), 1) AS [Avg Spills],
CONVERT(NVARCHAR(30), CAST((AvgSpills) AS MONEY), 1) AS [Avg Spills],
CONVERT(NVARCHAR(30), CAST((NumberOfPlans) AS BIGINT), 1) AS [# Plans],
CONVERT(NVARCHAR(30), CAST((NumberOfDistinctPlans) AS BIGINT), 1) AS [# Distinct Plans],
CONVERT(VARCHAR(25),PlanCreationTime,120) AS [Created At],
CONVERT(VARCHAR(25),LastExecutionTime,120) AS [Last Execution],
CONVERT(VARCHAR(25),LastCompletionTime,120) AS [Last Completion],
CONVERT(VARCHAR(256),QueryHash,1) AS [Query Hash],
CONVERT(VARCHAR(256),QueryPlanHash,1) AS [Query Plan Hash],
COALESCE(SetOptions, '''') AS [SET Options],
CONVERT(NVARCHAR(30), CAST((CachedPlanSize) AS BIGINT), 1) AS [Cached Plan Size (KB)],
CONVERT(NVARCHAR(30), CAST((CompileTime) AS BIGINT), 1) AS [Compile Time (ms)],
Expand Down

0 comments on commit c9676bf

Please sign in to comment.