Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sp_BlitzWho - tempdb allocations does not include internal objects such as worktables and workfiles #3174

Closed
Adedba opened this issue Nov 18, 2022 · 3 comments
Assignees

Comments

@Adedba
Copy link
Contributor

Adedba commented Nov 18, 2022

Version of the script
SELECT @Version = '8.11', @VersionDate = '20221013';

What is the current behavior?
Currently sp_BlitzWho will show tempdb allocations only for user objects such as temp tables etc but does not take into account internal objects such as workfiles and worktables.

If the current behavior is a bug, please provide the steps to reproduce.
Run a query that uses a worktable and/or workfile which takes at least a few seconds to run to allow you time to run sp_BlitzWho with expertmode = 1 in another query window and observe the tempdb allocations column..

Steps:

Confirm that this query uses a worktable and/or a workfile (it used both for me).

SET STATISTICS IO ON;

SELECT * 
FROM [dbo].[BlitzFirst_FileStats_Deltas]

just to make that query take longer on my system I did a cross apply like this in query window 1:

SELECT * 
FROM [dbo].[BlitzFirst_FileStats_Deltas]
CROSS APPLY (SELECT TOP 3 [number] FROM [master].[dbo].[spt_values]) x /* do this just to make the query take longer */

In Query window 2:

EXEC sp_BlitzWho @ExpertMode = 1;

Which versions of SQL Server and which OS are affected by this issue? Did this work in previous versions of our procedures?
Tested with SQL2012 and SQL2016

@Adedba Adedba self-assigned this Nov 18, 2022
Adedba added a commit to Adedba/SQL-Server-First-Responder-Kit that referenced this issue Nov 18, 2022
BrentOzarULTD#3174 - Included tempdb internal object allocations to tempdb_allocations_mb column.
@BrentOzar
Copy link
Member

@Adedba I haven't heard back from you, so I'll go ahead and close this for now, but if you decide you want to work on it, you can leave a comment here when you're ready to do a pull request, and I can reopen it.

@Adedba
Copy link
Contributor Author

Adedba commented Jan 6, 2023

Sorry about that, did the commit on my branch but never got round to creating the pull request! doh! created one now :)

@BrentOzar BrentOzar added this to the 2023-01 Release milestone Jan 31, 2023
@BrentOzar
Copy link
Member

Thanks for the pull request! Looks good, merging into the dev branch. Will be in the next release with credit to you in the release notes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants