tempdb in aggregate functions | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

tempdb in aggregate functions

I’m trying to get an understanding how, if at all, aggregate functions use tempdb. I have a simple SUM query: SELECT SUM(order_amt)
FROM order_line
WHERE order_date between ‘5/1/04’ and ‘6/1/04’ This query hits about 1 million rows out of a 50 million row table. I ran the Execution Plan for this query and it did not explicitly indicate the use of a temp/work table in tempdb. If it were using tempdb – would that be reflected in the Execution Plan? Thanks
It wouldn’t be reflected in the execution plan. They shouldn’t use tempdb at all. It should be confined to the memory and paging file. If you look at transactions/sec in Performance monitor, you can level it down to what actual database they’re occuring in. It can give you an idea if tempdb is being used for big processes as the t/sec would go up for that db considerably. MeanOldDBA
[email protected] When life gives you a lemon, fire the DBA.
]]>