x
login about faq Site discussion (meta-askssc)

Can bad joins fill up TempDB

If I have bad joins (that ignore indexes) on large tables, will that affect / fill up my TempDB database?

more ▼

asked Nov 28 '11 at 05:28 AM in Default

Raj More gravatar image

Raj More
1.7k 75 79 82

(comments are locked)
10|1200 characters needed characters left

2 answers: sort voted first

Heck yes. The different JOIN mechanisms within the optimizer can store information in tempdb. For example, a hash join builds a hash table which is in tempdb. A merge join might require a sort operation and the sort will take place in tempdb. That's just the first two that I thought of. There are others that can, and will, dump into tempdb. So yes, "bad" JOINs are an issue for tempdb.

more ▼

answered Nov 28 '11 at 06:19 AM

Grant Fritchey gravatar image

Grant Fritchey ♦♦
64.9k 13 20 66

(comments are locked)
10|1200 characters needed characters left

Yes very much possible. If the server is unable to keep it in the memory, then it will spill it to the tempdb space.

more ▼

answered Nov 28 '11 at 05:38 AM

Sacred Jewel gravatar image

Sacred Jewel
1.6k 2 4 5

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x101
x70
x43

asked: Nov 28 '11 at 05:28 AM

Seen: 932 times

Last Updated: Nov 28 '11 at 05:28 AM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.