March 24, 2008 at 8:04 am
I've seen DBCC DBREINDEX cause log files to grow quite rapidly, but never data files ... I have a database that shot up over 50gb yesterday when the only thing that should have been running would have been my weekly maintenance. I'm curious to know If it was infact my reindex that caused this sudden growth.
Thanks
March 24, 2008 at 8:22 am
It could cause it. What was the size of the largest table that you reindexed?
March 24, 2008 at 8:28 am
I think my biggest table in this database is 56gb.
The crazy thing is that sp_spaceused is reporting:
index_sizeunused
-2230440 KB-36888 KB
Negatives!? How is that possible?
March 24, 2008 at 9:38 am
Negatives because things are being calculated and added to other things and probably overflowed.
Because a reindex is transactional, the system has to keep copies of the old and new pages until it can swap things, so it can cause your largest table to grow the database if it's a significant portion of the database size.
March 24, 2008 at 9:40 am
I thought that all was done in the log ... wow, so even after the operation has completed, it won't release the space unless I shrink it?
March 24, 2008 at 9:55 am
Adam Bean (3/24/2008)
I think my biggest table in this database is 56gb.The crazy thing is that sp_spaceused is reporting:
index_sizeunused
-2230440 KB-36888 KB
Negatives!? How is that possible?
You have to update usage to make sure you get the correct size from sp_spacesued:
-- For whole database
exec sp_spaceused @updateusage = 'true'
-- For one table
exec sp_spaceused @objname = 'TableName', @updateusage = 'true'
This script will give you a better analysis of tables sizes:
Script to analyze table space usage:
March 24, 2008 at 10:14 am
Ah yeah, good call ... so that got me out of the negatives. These numbers still don't add up to the 50gb growth, but I'd assume that rebuilding the entire db's indexes would have been the root cause if in fact DBCC DBREINDEX does in fact cause data size growth.
March 25, 2008 at 9:42 am
So when comparing my current database to a backup taken before my maintenance ... the index/table sizes did not increase at all ... it appears that the unused space is all that increased ... meaning I have a bunch of white space in the data file.
Why would DBCC DBREINDEX cause such a thing? Can I expect to see this regularly? This really was the first time this server saw any type of real maintenance. It's been up and running for over 4 years and only has 5 indexes rebuilt on a weekly basis (not my doing, new here), and now I'm doing all indexes on all databases. I'm wondering if this is a one time growth or I need to get more disk space ...
Last time I worked with 2000 using DBCC DBREINDEX, the only growth I saw was on the log files.
Thanks
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply