|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Tuesday, May 14, 2013 2:56 AM
Points: 74,
Visits: 419
|
|
Hello there,
I'd like to understand a special behaviour.
Our tempdb-database is configured having 8 data files. As Microsoft recommends we have one data file for each core, all having same file size and grow rate.
When we start index reorganisation (NOT rebuild!) on a very big table the tempdb grows (of course). I wonder why only 1 of the data files is growing. One might think that all the data files would grow at the same time, maybe approxemately by the same size.
Does anyone have an explanation for this behaviour?
I personally think that the reorg-process uses only one processor and so the tempdb-file assoziated with this processor at excution time will grow whereas the other files remain in their size. By the way: If so, is there a possibility using more than one core for the reorg-process? I think it would be faster than. But the maxdop-option is only available for index-rebuild.
Thank's a lot, Wolf
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Today @ 11:12 AM
Points: 37,665,
Visits: 29,917
|
|
WolfgangE (1/24/2013) Our tempdb-database is configured having 8 data files. As Microsoft recommends we have one data file for each core, all having same file size and grow rate.
http://www.sqlskills.com/BLOGS/PAUL/post/A-SQL-Server-DBA-myth-a-day-%281230%29-tempdb-should-always-have-one-data-file-per-processor-core.aspx
When we start index reorganisation (NOT rebuild!) on a very big table the tempdb grows (of course).
Why 'of course'? Index reorgs shouldn't hit tempDB heavily, if at all, unless you have one of the snapshot isolation levels in use. Index reorgs use a single spare page in the user database to do the reorganisation. It's the index rebuilds (with sort in tempDB or online on) that hit TempDB hard.
Gail Shaw Microsoft Certified Master: SQL Server 2008, MVP SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
We walk in the dark places no others will enter We stand on the bridge and no one may pass
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Friday, May 17, 2013 8:50 AM
Points: 2,035,
Visits: 3,759
|
|
Our tempdb-database is configured having 8 data files. As Microsoft recommends we have one data file for each core, all having same file size and grow rate. They also recommend sizing the tempdb files accordingly (for you anticipated usage) and disabling the autogrowth. Please read through the link Gail has posted.
______________________________________________________________________________ "Never argue with an idiot; They'll drag you down to their level and beat you with experience"
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Tuesday, May 14, 2013 2:56 AM
Points: 74,
Visits: 419
|
|
Thank's for the answers and the link. I'll go trough it in detail.
Yes, we have snapshot isolation set to on. I can see that during reorganisaton of our largest table the disk space of the tempdb disk is reduced dramatically (it's just because our monitoring sends a warning).
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Today @ 11:12 AM
Points: 37,665,
Visits: 29,917
|
|
Right, so the TempDB usage is not due to the reorg using TempDB, it's the snapshot isolation and the row version store.
To be honest, I'm not 100% sure how the row version store interacts with multiple files.
Gail Shaw Microsoft Certified Master: SQL Server 2008, MVP SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
We walk in the dark places no others will enter We stand on the bridge and no one may pass
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Tuesday, May 14, 2013 2:56 AM
Points: 74,
Visits: 419
|
|
GilaMonster (1/24/2013) it's the snapshot isolation and the row version store.
I'm not familiar with this term but I'll try to learn a bit more about it and why it affects our tempdb that way.
Thank you
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Today @ 9:49 AM
Points: 341,
Visits: 1,308
|
|
|
|
|