Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

TempDB usage per active session Expand / Collapse
Author
Message
Posted Tuesday, January 4, 2011 8:47 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 9:55 AM
Points: 5,460, Visits: 13,046
Comments posted to this topic are about the item TempDB usage per active session

--
Gianluca Sartori

How to post T-SQL questions
spaghettidba.com
@spaghettidba
Post #1042794
Posted Thursday, September 25, 2014 7:52 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Monday, June 27, 2016 8:37 AM
Points: 912, Visits: 2,656
Very interesting, though I'd find a version that looks for not only internal objects, but also explicit objects like #temp and ##global temp tables, and even "real" tables in tempdb, etc. etc., which in my environment are (regrettably, in the case of the "real" tables) common.
Post #1619753
Posted Wednesday, December 2, 2015 7:58 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Wednesday, January 27, 2016 3:30 AM
Points: 2,871, Visits: 379
Thanks for helping me identify a query where by using OPTION(RECOMPILE) I was able to reduce execution time of "completely unpredictable" to a few seconds.


ML

---
Matija Lah, SQL Server MVP
http://milambda.blogspot.com
Post #1741957
Posted Wednesday, December 2, 2015 3:11 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 9:55 AM
Points: 5,460, Visits: 13,046
My pleasure, Matija!
Was the query using a lot of tempdb space? I'm curious to know how OPTION RECOMPILE made it stop doing so. Maybe a wrong cached plan?


--
Gianluca Sartori

How to post T-SQL questions
spaghettidba.com
@spaghettidba
Post #1742121
Posted Monday, December 7, 2015 3:50 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Wednesday, January 27, 2016 3:30 AM
Points: 2,871, Visits: 379
The query is used for a rather complex computation needed in the result of a highly used stored procedure.

Occasionally, the execution plan would include a Hash Join operator in a particular JOIN clause that worked well for some workloads, but ended up creating multi-million-row work tables for other workloads, where a paralel plan using the Merge Join, and Nested Loops, operators would have been more appropriate.

Because of the complexity of the query (which someone else, other than myself should also be able to maintain ), I didn't want to complicate things further, either by using explicit join hints (i.e. in specific JOIN clauses), or by specifying query-level join hints (e.g. OPTION(MERGE JOIN, LOOP JOIN), which would have prevented the use of the Hash Join operator altogether.

OPTION(RECOMPILE) does cause some overhead (which isn't completely insignificant), but it keeps the behavior of this particular query predictable. Considering the full scale of what the procedure is used for, this is a highly significant benefit.



ML

---
Matija Lah, SQL Server MVP
http://milambda.blogspot.com
Post #1743135
Posted Saturday, April 23, 2016 4:42 PM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 12:57 PM
Points: 2,862, Visits: 3,580
Thanks so much for this query. Is there a similar one for retrieving tempdb log space used per SPID?

I'd like to track such a query for an issue where an as-yet unknown query is causing periodic large increases in the percent of log space used.

Thanks for any help!

- webrunner


-------------------
"I love spending twice as long and working twice as hard to get half as much done!" – Nobody ever.
Ref.: http://www.adminarsenal.com/admin-arsenal-blog/powershell-how-to-write-your-first-powershell-script

"Operator! Give me the number for 911!" - Homer Simpson

"A SQL query walks into a bar and sees two tables. He walks up to them and says 'Can I join you?'"
Ref.: http://tkyte.blogspot.com/2009/02/sql-joke.html
Post #1780349
Posted Sunday, April 24, 2016 12:38 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Today @ 8:48 AM
Points: 849, Visits: 1,601
Nice and useful script! Thanks!

----------------------------------------------------------------------------------------------------------------------------------------------------
Roshan Joe


Jeff Moden -Forum Etiquette: How to post data/code on a forum to get the best help
Post #1780358
Posted Tuesday, May 17, 2016 6:57 AM
SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 6:34 AM
Points: 7,889, Visits: 764
Thanks for the script.
Post #1786846
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse