Skip to content

Commit 7b3b0c8

Browse files
Merge pull request #756 from erikdarlingdata/dev
sp_QuickieCache: CPU tie-breaker for duplicate plans sort
2 parents 0131faf + 9d03cc9 commit 7b3b0c8

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

sp_QuickieCache/sp_QuickieCache.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
498498
HAVING
499499
COUNT_BIG(DISTINCT qs.plan_handle) > 1
500500
ORDER BY
501-
COUNT_BIG(DISTINCT qs.plan_handle) DESC
501+
COUNT_BIG(DISTINCT qs.plan_handle) DESC,
502+
SUM(qs.total_worker_time) DESC
502503
OPTION(RECOMPILE, MAXDOP 1);
503504

504505
RETURN;

0 commit comments

Comments
 (0)