Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

tempdb: only one of several data files is growing on Index-Reorg Expand / Collapse
Author
Message
Posted Thursday, January 24, 2013 5:47 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, October 3, 2014 1:55 PM
Points: 199, Visits: 735
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
Post #1411088
Posted Thursday, January 24, 2013 5:53 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Yesterday @ 6:05 AM
Points: 40,258, Visits: 36,681
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

Post #1411093
Posted Thursday, January 24, 2013 6:45 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Thursday, October 16, 2014 6:18 PM
Points: 3,961, Visits: 7,170
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"
Post #1411111
Posted Thursday, January 24, 2013 7:05 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, October 3, 2014 1:55 PM
Points: 199, Visits: 735
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).
Post #1411120
Posted Thursday, January 24, 2013 7:17 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Yesterday @ 6:05 AM
Points: 40,258, Visits: 36,681
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

Post #1411124
Posted Thursday, January 24, 2013 7:32 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, October 3, 2014 1:55 PM
Points: 199, Visits: 735
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
Post #1411137
Posted Thursday, January 24, 2013 12:59 PM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Today @ 7:00 AM
Points: 950, Visits: 2,960
GilaMonster (1/24/2013)
To be honest, I'm not 100% sure

Shock, horror.




The SQL Guy @ blogspot

@SeanPearceSQL

About Me
Post #1411316
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse