Skip to content

Commit 36f7975

Browse files
committed
Include tempdb internal allocations
BrentOzarULTD#3174 - Included tempdb internal object allocations to tempdb_allocations_mb column.
1 parent ebec3dd commit 36f7975

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎sp_BlitzWho.sql‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@ BEGIN
859859
OUTER APPLY sys.dm_exec_sql_text(COALESCE(r.sql_handle, blocked.sql_handle)) AS dest
860860
OUTER APPLY sys.dm_exec_query_plan(r.plan_handle) AS derp
861861
OUTER APPLY (
862-
SELECT CONVERT(DECIMAL(38,2), SUM( (((tsu.user_objects_alloc_page_count - user_objects_dealloc_page_count) * 8) / 1024.)) ) AS tempdb_allocations_mb
862+
SELECT CONVERT(DECIMAL(38,2), SUM( ((((tsu.user_objects_alloc_page_count - user_objects_dealloc_page_count) + (tsu.internal_objects_alloc_page_count - internal_objects_dealloc_page_count)) * 8) / 1024.)) ) AS tempdb_allocations_mb
863863
FROM sys.dm_db_task_space_usage tsu
864864
WHERE tsu.request_id = r.request_id
865865
AND tsu.session_id = r.session_id
@@ -1152,7 +1152,7 @@ IF @ProductVersionMajor >= 11
11521152
OUTER APPLY sys.dm_exec_sql_text(COALESCE(r.sql_handle, blocked.sql_handle)) AS dest
11531153
OUTER APPLY sys.dm_exec_query_plan(r.plan_handle) AS derp
11541154
OUTER APPLY (
1155-
SELECT CONVERT(DECIMAL(38,2), SUM( (((tsu.user_objects_alloc_page_count - user_objects_dealloc_page_count) * 8) / 1024.)) ) AS tempdb_allocations_mb
1155+
SELECT CONVERT(DECIMAL(38,2), SUM( ((((tsu.user_objects_alloc_page_count - user_objects_dealloc_page_count) + (tsu.internal_objects_alloc_page_count - internal_objects_dealloc_page_count)) * 8) / 1024.)) ) AS tempdb_allocations_mb
11561156
FROM sys.dm_db_task_space_usage tsu
11571157
WHERE tsu.request_id = r.request_id
11581158
AND tsu.session_id = r.session_id

0 commit comments

Comments
 (0)