Skip to content

Commit 5a8b922

Browse files
Merge pull request #706 from erikdarlingdata/dev
sp_QuickieStore: @sort_order tiebreaker for @find_high_impact
2 parents 36d38f4 + bdadf63 commit 5a8b922

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

sp_QuickieStore/sp_QuickieStore.sql

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5657,7 +5657,16 @@ OUTER APPLY
56575657
qsp.last_execution_time DESC
56585658
) AS qp
56595659
ORDER BY
5660-
o.impact_score DESC
5660+
o.impact_score DESC,
5661+
' +
5662+
CASE LOWER(@sort_order)
5663+
WHEN 'duration' THEN N'o.duration_share'
5664+
WHEN 'physical reads' THEN N'o.physical_reads_share'
5665+
WHEN 'writes' THEN N'o.writes_share'
5666+
WHEN 'memory' THEN N'o.memory_share'
5667+
WHEN 'executions' THEN N'o.executions_share'
5668+
ELSE N'o.cpu_share'
5669+
END + N' DESC
56615670
OPTION(RECOMPILE);' + @nc10;
56625671

56635672
IF @debug = 1

0 commit comments

Comments
 (0)