We are trying to analyze the growth of tempdb on one of our SQL server 2005 Ent SP4.
I know tempdb would need the space depending upon the transactions, and how queries are designed to use it.
We had an issue for disk space getting full , where we analyzed how tempdb grew that big over a week.
After a reboot, via monitoring we came across 4-5 queries, which were holding up version store for more than 20 minutes, grew tempdb same day from its initial size of 2 GB ( 4 data files) to over 100 GB within a spam of 6-8 hours.
query A holds the version store for 10 minutes where current version generation rate was 23.81 KB/sec and the cleanup rate was 0.00 KB/sec. The version store size was 17 MB and tempdb file size was 10332 MB.
Later after an hour the query B ran, the version store for 16 minutes where current version generation rate was 33.81 KB/sec and the cleanup rate was 0.00 KB/sec. The version store size was 45 MB and tempdb file size was 45332MB.
Similarly a query C ran after 3-4 hours, the version store for 15 minutes where current version generation rate was 33.81 KB/sec and the cleanup rate was 0.00 KB/sec. The version store size was 19 MB and tempdb file size was 85332MB.
and so on on. during our monitoring for that day.
Now same queries run next day and day after,
We see that tempdb allocations and dellocations value running to somewhat similar during the very first day, but tempdb did not grew that fast.
same happens for upcoming 7-8 days where growth is approx 8-10 GB compared to first day where it grew to 100 GB for the similar queries running each day.
Also , the current output of
select count(*) from sys.dm_tran_version_store
is 196470 and its been 2 days since a reboot.
May be i am unaware of some process here, but please help me understand what could be the reason apart from those identified queries as we are trying to improve if they are the one causing tempdb to grow that much.
Note* tempdb size is 110 GB and Free space it shows is almost 109 GB.