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: Yesterday @ 7:12 AM
Points: 5,326, Visits: 12,605
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: Yesterday @ 10:56 PM
Points: 910, Visits: 2,631
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: Yesterday @ 7:12 AM
Points: 5,326, Visits: 12,605
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
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse