SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Datawarehouse - My PO keeps asking for more tempdb


Datawarehouse - My PO keeps asking for more tempdb

Author
Message
Brian-444611
Brian-444611
SSC-Enthusiastic
SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)

Group: General Forum Members
Points: 112 Visits: 160
I think we have all been in this situation before. Devs fill TEMPDB then say they need more TEMPDB.

Here is my setup: I have a 4 node DW each with about a 1-1.5TB database living on them. My largest table is about 850GB in each. (1,440,695,540 rows, 353,312,408KB data, 510,599,720KB index (lol yea)).

My tempdb is setup like this:
8 5GB data files (so 40GB total tempdb data file space)
1 10GB log file

As a dba here is what I have always maintained: if your query takes more than 10GB of tempdb to run, the query and/or design is flawed. in this case I have given them 40GB data and 10GB log and yet they still manage to fill that from time to time with queries that run for hours. yes, the fill can be a stats issue. In either situation, imo, the solution is NOT to add more tempdb, but to fix the underlying problem w/ the query/stats.

So really discuss this and help chime in with your feedback on whether you think my logic is correct in that my file sizes are adequate and you should fix the root cause, or I should give in and give more tempdb space for what I viewed as flawed logic.
GilaMonster
GilaMonster
SSC Guru
SSC Guru (412K reputation)SSC Guru (412K reputation)SSC Guru (412K reputation)SSC Guru (412K reputation)SSC Guru (412K reputation)SSC Guru (412K reputation)SSC Guru (412K reputation)SSC Guru (412K reputation)

Group: General Forum Members
Points: 412258 Visits: 47117
There are some things that need lots of TempDB space. Let's take that 850MB table of yours, say a query needs 10% of it and needs to sort the results. That requires ~35GB of sort space. That's either in memory or it's in TempDB, I somehow doubt you have 35GB of memory available for a single query to use (that's above and beyond the buffer pool, plan cache and all other caches), so the sort spills to TempDB

CheckDB uses lots of TempDB. Index rebuilds use lots if you're doing sort in TempDB. Snapshot and read committed snapshot isolation levels use TempDB. Triggers use TempDB. Temp tables, table variables, hash joins, spools, sorts all use TempDB.

Before you conclude it's flawed logic and idiot devs, take a look at what queries are using the most TempDB space and investigate why they're using so much.

Personally, I think you're a little low on TempDB. I remember a 1 TB database with 120GB of TempDB space in total, and it used that space.

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


Brian-444611
Brian-444611
SSC-Enthusiastic
SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)

Group: General Forum Members
Points: 112 Visits: 160
All valid and appreciated points.

One quick thing to add on, in 100% of circumstances a stats update solves the issue. We do have regular maint on stats too. We just have a mix of large and small customers in our warehouse so sometimes a scan may occur due to the "tipping point" of data being returned from the table.
GilaMonster
GilaMonster
SSC Guru
SSC Guru (412K reputation)SSC Guru (412K reputation)SSC Guru (412K reputation)SSC Guru (412K reputation)SSC Guru (412K reputation)SSC Guru (412K reputation)SSC Guru (412K reputation)SSC Guru (412K reputation)

Group: General Forum Members
Points: 412258 Visits: 47117
In that case you have queries that are very sensitive to stats inaccuracies and probably need to identify the tables involved and schedule more frequent stats updates on those tables/indexes/stats.

Edit: Or you have queries/procedures susceptible to bad parameter sniffing problems and probably want to identify and fix them.

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


Brian-444611
Brian-444611
SSC-Enthusiastic
SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)

Group: General Forum Members
Points: 112 Visits: 160
You would love our environment. All these problem queres are "Advanced Search" queries which call a proc which generates and executes dynamic sql. Most of which have tons and tons of joins.
GilaMonster
GilaMonster
SSC Guru
SSC Guru (412K reputation)SSC Guru (412K reputation)SSC Guru (412K reputation)SSC Guru (412K reputation)SSC Guru (412K reputation)SSC Guru (412K reputation)SSC Guru (412K reputation)SSC Guru (412K reputation)

Group: General Forum Members
Points: 412258 Visits: 47117
Nothing wrong with that. Better than trying to do a catch-all type query that can handle any number of optional parameters.

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


Brian-444611
Brian-444611
SSC-Enthusiastic
SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)

Group: General Forum Members
Points: 112 Visits: 160
you kinda sound like my DBEs Smile


but no seriously this advanced search thing has an endless number of parameters and generates 100+ line queries that are just ugly. it's like "lets do a 30 table view" situation
Bhuvnesh
Bhuvnesh
SSC-Insane
SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)

Group: General Forum Members
Points: 23950 Visits: 4079
Brian-444611 (11/15/2012)
but no seriously this advanced search thing has an endless number of parameters and generates 100+ line queries that are just ugly. it's like "lets do a 30 table view" situation
i think you also need to think to move tempdb files (i assume you have multiple) on different seperate disks.
see this http://blogs.msdn.com/b/sqlserverstorageengine/archive/2009/01/04/managing-tempdb-in-sql-server-tempdb-configuration.aspx

-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done;-)
Brian-444611
Brian-444611
SSC-Enthusiastic
SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)

Group: General Forum Members
Points: 112 Visits: 160
Bhuvnesh (11/20/2012)
Brian-444611 (11/15/2012)
but no seriously this advanced search thing has an endless number of parameters and generates 100+ line queries that are just ugly. it's like "lets do a 30 table view" situation
i think you also need to think to move tempdb files (i assume you have multiple) on different seperate disks.
see this http://blogs.msdn.com/b/sqlserverstorageengine/archive/2009/01/04/managing-tempdb-in-sql-server-tempdb-configuration.aspx


My tempdb is on solid state in my cx4 array attached to my host w/ 8GB HBAs. Not gonna get much faster than that Smile
Bruce W Cassidy
Bruce W Cassidy
SSCertifiable
SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)

Group: General Forum Members
Points: 5259 Visits: 1033
40gb of tempdb isn't a lot (even if it's on SSD). For even a relatively small DW (say, a couple of TB in size), I generally aim for around 10% as tempdb (more if the DW and ETL are sharing the same system -- a couple of large online index rebuilds will blow out tempdb in no time flat).

While I appreciate the sentiments of the DBA saying "oh, the developers don't need that much tempdb", it's actually about getting the data out to the customers in the most expeditious fashion. Sometimes that means just getting on with it and not having to constantly worry about the "best approach"; there's an old saying that "best is the enemy of good enough."

The tempdb is one of those things where you can throw extra space at it to enable getting stuff done easily. Think of it as helping to enable your developers, if you like (and in most cases, developer time is the most precious resource of all).

You still need to keep an eye on what's going on and ensure that there is a process to get the inefficient stuff refactored (otherwise you will need infinite resources and processing power). From what you have described, you already have candidates in mind for that.

My suggestion would be to negotiate with the developers: you give them additional tempdb if they put in place a refactoring process. That way they can still do quick turn-around on data and query delivery, while you can ensure that long term your system doesn't bog down.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum







































































































































































SQLServerCentral


Search