Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

TEMPDB and TempDev

Posted on 2004-04-28
5
Medium Priority
?
1,048 Views
Last Modified: 2011-10-03
The TEMPDB Database on our server has been growing at an alarming rate. It gets up to 16 Gig some days before we get a chance to shrink it.

I've been told that complex SQL Queries and Complex Joins will cause TEMPDB to grow. Is this true? And if it is, why is this the case...in other words, what would a SQL Query use TEMPDB for?

We are trying to use SQL Profiler to isolate what is causing TEMPDB to grow...is this the correct approach?

Thanks
0
Comment
Question by:ONYX
  • 4
5 Comments
 
LVL 34

Expert Comment

by:arbert
ID: 10940900
Yes, this is true.  Temp tables, and large sorts will also use TEMPDB.....Using profiler should allow you to capture most statements that hit tempdb....
0
 
LVL 34

Accepted Solution

by:
arbert earned 200 total points
ID: 10940933
0
 

Author Comment

by:ONYX
ID: 10941306
I appreciate the comments and the links. That does help. If we do not use Temp Tables in our application, but we do use large sql queries with complex joins, would temp db still fill up? I did note that tempdb is use for sorts...
Thanks again.
0
 
LVL 34

Expert Comment

by:arbert
ID: 10945130
It's possible--just depends on how large and complex things get.  SQL will also use tempdb for other things as well.  Sometimes you may not create a temp table, but SQL will in order to speed things up.  
0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how the fundamental information of how to create a table.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question