Live classes start in 1d 06h 51m — Save your seat

Instance Resource Pressure and Tempdb

CPU, memory, tempdb, and related instance-level bottlenecks.

53 associated posts51 primary posts

[Video] Office Hours: Ask Me Anything About SQL Server

Erika and I are on the road in Iceland, roaming around the countryside, and I'm taking you with us. This week, we're in Siglufjörður, a beautiful little oceanfront fishing village in the north. In the mornings, before Erika wakes up, I'm filming Office Hours videos to answer your questions that you post here. The first video comes to you from a park bench next to the harbor:

Read more about [Video] Office Hours: Ask Me Anything About SQL Server 17 comments — Join the discussion

Page Life Expectancy Doesn’t Mean Jack, and You Should Stop Looking At It.

Page Life Expectancy is a Perfmon counter that's supposed to track how long pages stay in memory before they get flushed out to make room for other pages that are needed instead.

Paul Randal has blogged this a few times, and rather than rehash 'em, I'd rather point you to a couple of his roundups:

Read more about Page Life Expectancy Doesn’t Mean Jack, and You Should Stop Looking At It. 28 comments — Join the discussion

Three Reasons to (Temporarily) Change Max Worker Threads

When you go to the deli, there's a "take a number" dispenser where you tear off a number and wait for your number to be called.

If you walked into a deli and you saw 50 people lined up all waiting their turn, and you went to take a number and the dispenser was completely empty, you'd say to yourself, "I think I'll come back later."

Read more about Three Reasons to (Temporarily) Change Max Worker Threads 10 comments — Join the discussion

[Video] Office Hours 2018/12/5 (With Transcriptions)

This week, Tara and Richie discuss deletes on heaps, Docker, using containers in production environment, advice for new DBA, downgrading server hardware, agent jobs, setting SQL Memory Min and Max to the same value, how to prove CPU pressure to management using the Power BI report using sp_Blitz, corruption, patching, backups, sargability, and more.

Read more about [Video] Office Hours 2018/12/5 (With Transcriptions) Be the first to comment

[Video] Office Hours 2018/8/8 (With Transcriptions)

This week, Brent, Tara, Erik, and Richie discuss troubleshooting port blocking, page life expectancy issues, problems with turning off CPU schedulers, coordinating two jobs across servers, adding additional log files to an almost-full partition, tips for getting a new SQL Server DBA job, using alias names for SQL Servers, database going into suspect mode during disaster recovery, SQL Constant Care "Too Much Memory" warning, index operational statistics, running newer versions of SQL Server with databases in older version compat mode, and more!

Read more about [Video] Office Hours 2018/8/8 (With Transcriptions) Be the first to comment

[Video] Office Hours 2018/7/18 (With Transcriptions)

This week, Brent, Erik, and Tara discuss their SQL server specialization, CPU-ready time, making SSIS changes globally rather than one at a time, creating an Always On AG farm, Azure managed instances, going from log shipping to Availability Groups, tracking folks that executed queries, moving databases into Availability Groups, an exciting update to SQL Server 2016, and Brent's upcoming move across country.

Read more about [Video] Office Hours 2018/7/18 (With Transcriptions) Be the first to comment
T-SQL & Development

Concurrency Week: How Entity Framework and NHibernate Can Cause Poison RESOURCE_SEMAPHORE Waits

I've already blogged about my dislike for ORMs from a production DBA performance tuning standpoint only. I get that they're useful to developers. I get it. But I'm focused on performance.

A quick recap of what I don't like about ORMs from that other blog post:

Read more about Concurrency Week: How Entity Framework and NHibernate Can Cause Poison RESOURCE_SEMAPHORE Waits 6 comments — Join the discussion

[Video] Office Hours 2018/1/31 (With Transcriptions)

This week, Brent, Tara, and Richie discuss a simple way to fill tempdb, tools for retrieving data from transaction logs, tools for diagraming server architecture, their favorite counters for checking if SQL server on VMWare has sufficient memory, SSRS subscription issues, change requests, thread pool issues, best practices for SELECT * into, failover SQL Server vs failover SAN, backups, and more.

Read more about [Video] Office Hours 2018/1/31 (With Transcriptions) 2 comments — Join the discussion

[Video] Office Hours 2017/05/24 (With Transcriptions)

This week, Brent, Erik, and Richie discuss disabling telemetry in SQL Server 2016, proper place for log files, Availability Groups, measuring data returned from a single query, whether CHECKDB should be done on tempdb, limiting tempdb usage for each session, transferring large amounts of data from on-prem to the cloud, and Iron Chef spoilers.

Here’s the video on YouTube:

Read more about [Video] Office Hours 2017/05/24 (With Transcriptions) Be the first to comment

[Video] Office Hours 2017/05/10 (With Transcriptions)

This week, Tara and Richie discuss increasing the size of tempdb, splitting database across several files, tracking DML changes to a table, upgrading different versions of service packs, recommendations for improving T-SQL skills, trace flags, replication, Always On Availability Groups, compatibility level of databases,  and more...

Here’s the video on YouTube:

Read more about [Video] Office Hours 2017/05/10 (With Transcriptions) Be the first to comment

Max Worker Threads: Don’t Touch That

More isn't faster
I've had people give me all sorts of janky reasons for changing Max Worker Threads. I've even had people tell me that someone from Microsoft told them to do it.

The thing is, all changing that setting does is help you not run out of worker threads. It doesn't make queries run any better or faster. In fact, under load, performance will most likely be downgraded to Absolute Rubbish© either way.

Read more about Max Worker Threads: Don’t Touch That 57 comments — Join the discussion
News & Opinion

Bad Idea Jeans: Dynamically Generating Ugly Queries and Task Manager Graffiti

Say you're at Dell DBA Days, and you want to build a really ugly query, fast. You want to generate a StackOverflow database query that will take a long time to compile, and maybe demand a huge amount of memory to run, but not actually take any time to execute.

You might start by building a numbers table with Method #7 from this StackOverflow answer, and then:
[crayon-6ae69f01470f0182298260/]
Which gives you a 10,000 join query, but I'm only showing the first 10 lines here:

Read more about Bad Idea Jeans: Dynamically Generating Ugly Queries and Task Manager Graffiti 10 comments — Join the discussion
Performance Tuning

When Shrinking Tempdb Just Won’t Shrink

Your queries won’t tune themselves. My 2027 Live Class Season Pass is $995 (normally $4,395), with live Fundamentals and Mastering classes plus recordings. Register by October 31 to join Fundamentals Week, November 2–6. See the pass.

I am not a proponent of shrinking databases, but sometimes you have to because your momma said to. Sometimes that database is tempdb.

Read more about When Shrinking Tempdb Just Won’t Shrink 71 comments — Join the discussion