Query expands tempdb in SQL Server
Posted on 2013-01-25
I have a view that I am running through Management Studio in the query widow. I am selecting 1000 records. When I run it, the tempdb table grows very quickly and the query takes several minutes to run. Tempdb can go from 1 mb to 1 gb in a few minutes. The query uses COUNT(*) , GROUP BY and HAVING. All tables (6) are indexed and I reoganized all of the indexes while testing. A web page that calls the view runs with no affect on tempdb. No other views in this database have the problem. Any idea why this would happen?