September 22, 2014 at 9:57 pm
Hello I've recently kicked off an archiving/Migration project which inserts rows from a source table on database A to an identical destination table on database B. I take some table size statistics using sp_spaceused before and after the each migration and have found that the amount of space that is being released on the source table is significantly lower then the amount of space that is being claimed on the destination.
For example, the pre-post migration difference between the 'reserved' sp_spaceused value on the source table is 0.64 gb's, on the destination table it's 3.17 gb's
I should mention that the table contains blob images that are stored in LOB pages.
I've attached a table schema script and an excel sheet with the outputs from sp_spaceused
September 23, 2014 at 12:26 am
Maybe the source table is compressed?
(ps: you didn't add anything in attachment)
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
September 23, 2014 at 12:31 am
No table is not compressed I've just added the attachments 🙂
September 24, 2014 at 5:58 pm
Can anyone help out here?
September 24, 2014 at 6:15 pm
do both databases have same auto-growth settings ?
is the fill factor of indexes on both tables same ?
September 24, 2014 at 6:25 pm
I've compared the create table scripts and they are exactly the same as well the indexes. My thoughts were that something may be happening around the LOB pages, maybe the image records were not getting deleted or database was not being released
September 24, 2014 at 9:55 pm
Quick thought to rule out some problems, have you checked the logs for error messages or the output of DBCC CHECKDB?
😎
September 24, 2014 at 11:28 pm
-- Update usage
EXEC sp_spaceused 'dbo.pr_history', @updateusage = N'TRUE'
-- Check for ghost records
select * from sys.dm_db_index_physical_stats(DB_ID(),OBJECT_ID('pr_history'),NULL, NULL, 'DETAILED')
-- Rebuild the index
ALTER INDEX [pr_history_PK] ON [dbo].[pr_history] REBUILD
September 25, 2014 at 3:58 am
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply