patternMinor
Rebuilding index has impact on mdf/ldf files SQL Server 2008
Viewed 0 times
mdfimpact2008sqlhasfilesldfserverindexrebuilding
Problem
While rebuilding index have used option 'SORT_IN_TEMPDB = ON' in order to avoid unnecessary growing your user database files.
What does it exactly means?
Is complete process done on
For example before reindex (database is in simple recovery mode), the largest index size in the database is 25GB
What will be the approximate size for
What does it exactly means?
Is complete process done on
TempDB and does not grow mdf/ldf file size?For example before reindex (database is in simple recovery mode), the largest index size in the database is 25GB
.mdfsize (100GB allocated and used --> no freespace)
.ldfsize (20GB)
TempDBhas 200GB freespace
What will be the approximate size for
.mdf & .ldf files. Are they grow or not?Solution
When you rebuild an index the database engine creates what is called an "intermediate sort result." These intermediate results are like chunks that are combined to become your index and creating these chunks requires space. If it can the database engine will actually sort the index in memory; but if not it will store the intermediate results in the destination file group.
Using the SORT_IN_TEMPDB option asks SQL Server to store these intermediate results in TempDb instead of rebuilding them in the source database. When the TempDb resides on a different disk to the source database this can help the performance of the rebuild task and can reduce the performance impact on your database.
A requirement of rebuilding indexes is that you must have sufficient space (wherever you decide to build the index) to hold the largest index in your database: this in your example is 25GB. Which, if you use TempDb you should quite easily have.
As to whether your source database will grow, well I wouldn't rule it out but it won't grow anywhere near to what it would if you rebuilt the indexes within it. If you are concerned about this fact then take a copy of the database and put it in a test environment and try it out - it is the only way to really know for sure.
SORT_IN_TEMPDB:
http://msdn.microsoft.com/en-us/library/ms188281.aspx
I hope this helps you.
Using the SORT_IN_TEMPDB option asks SQL Server to store these intermediate results in TempDb instead of rebuilding them in the source database. When the TempDb resides on a different disk to the source database this can help the performance of the rebuild task and can reduce the performance impact on your database.
A requirement of rebuilding indexes is that you must have sufficient space (wherever you decide to build the index) to hold the largest index in your database: this in your example is 25GB. Which, if you use TempDb you should quite easily have.
As to whether your source database will grow, well I wouldn't rule it out but it won't grow anywhere near to what it would if you rebuilt the indexes within it. If you are concerned about this fact then take a copy of the database and put it in a test environment and try it out - it is the only way to really know for sure.
SORT_IN_TEMPDB:
http://msdn.microsoft.com/en-us/library/ms188281.aspx
I hope this helps you.
Context
StackExchange Database Administrators Q#22809, answer score: 6
Revisions (0)
No revisions yet.