Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

Datawarehouse - My PO keeps asking for more tempdb Expand / Collapse
Author
Message
Posted Thursday, November 15, 2012 9:43 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, February 11, 2013 2:54 PM
Points: 8, 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.



Post #1385251
Posted Thursday, November 15, 2012 10:01 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 11:36 AM
Points: 39,908, Visits: 36,247
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 2008, MVP
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

Post #1385257
Posted Thursday, November 15, 2012 12:41 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, February 11, 2013 2:54 PM
Points: 8, 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.
Post #1385318
Posted Thursday, November 15, 2012 12:45 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 11:36 AM
Points: 39,908, Visits: 36,247
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 2008, MVP
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

Post #1385321
Posted Thursday, November 15, 2012 3:17 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, February 11, 2013 2:54 PM
Points: 8, 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.
Post #1385378
Posted Thursday, November 15, 2012 4:08 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 11:36 AM
Points: 39,908, Visits: 36,247
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 2008, MVP
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

Post #1385389
Posted Thursday, November 15, 2012 6:59 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, February 11, 2013 2:54 PM
Points: 8, Visits: 160
you kinda sound like my DBEs :)


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
Post #1385413
Posted Tuesday, November 20, 2012 1:13 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Tuesday, August 19, 2014 12:26 AM
Points: 2,840, Visits: 3,963
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
Post #1386717
Posted Tuesday, November 20, 2012 5:17 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, February 11, 2013 2:54 PM
Points: 8, 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 :)
Post #1387195
Posted Wednesday, November 21, 2012 11:25 AM


Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Tuesday, July 22, 2014 4:12 PM
Points: 758, Visits: 1,031
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.
Post #1387539
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse