August 5, 2014 at 8:16 am
I have a database around 600 GB out of that A table is 398 GB, index size is 3 GB free space arund 5 GB. What are options do I have to make the table (database) smaller?
August 5, 2014 at 8:22 am
Disk space is pretty cheap now a days, why make it smaller? Is archiving a possibility? You can play with compression, but I wouldn't just try it in production plus it depends on what data you are storing.
August 5, 2014 at 8:23 am
Delete data?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
August 5, 2014 at 9:06 am
thanks for your time. One more question, how can I track what causing GB growth? Is there any script I can run to track table size growth/index size?
August 5, 2014 at 9:09 am
August 5, 2014 at 9:22 am
If you have Enterprise SQL Server you can turn on compression
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
August 5, 2014 at 11:18 am
TDE is enabled, do you think page compression will work?
August 5, 2014 at 5:33 pm
smtzac (8/5/2014)
TDE is enabled, do you think page compression will work?
Possibly. If I remember correctly (and we're going off my memory, so Katy bar the door), they compress before they encrypt in terms of storage processing. But a little searching on the interwebs is likely to come up with a definitive answer.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
August 5, 2014 at 7:59 pm
smtzac (8/5/2014)
thanks for your time. One more question, how can I track what causing GB growth? Is there any script I can run to track table size growth/index size?
Sure, use this script
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
August 5, 2014 at 9:40 pm
smtzac (8/5/2014)
I have a database around 600 GB out of that A table is 398 GB, index size is 3 GB free space arund 5 GB. What are options do I have to make the table (database) smaller?
Is the table an "audit" table? That would explain a lot...
--Jeff Moden
Change is inevitable... Change for the better is not.
August 6, 2014 at 2:22 am
Here are a few options to make that single table "smaller":
If the table contains a rather large number of columns (e.g. 50 or more) you might consider "vertical partitioning", meaning to add a second table with the same primary key and splitt the columns (if columns can be grouped logically, even better...).
If the size is due to a large number of rows, you might consider "horizontal partitioning",e.g. by moving "old data" to one or more archive table(s), e.g. one per year.
Finally, evaluate the data type used for the column definitions and if it's defined for the size needed. For example, a NCHAR(255) to store either "Yes" or "No" could be reduced to VARCHAR(3)...
August 6, 2014 at 12:08 pm
Thank you guys for your time 🙂
August 6, 2014 at 12:51 pm
smtzac (8/6/2014)
Thank you guys for your time 🙂
You still haven't identified whether or not it's an audit table. If it is, a whole 'nuther world can be opened to solve the problem of "huge" tables.
--Jeff Moden
Change is inevitable... Change for the better is not.
August 6, 2014 at 3:36 pm
I'm surprised nobody has discussed normalization... or did I miss something? It would be good if @smtzac could script the CREATE TABLE and tell us a bit about it (how many rows, what is it's purpose etc). Is it a transactional table or a flat data dump? Also what version od SQL Server is it on?
...One of the symptoms of an approaching nervous breakdown is the belief that ones work is terribly important.... Bertrand Russell
August 6, 2014 at 5:00 pm
LutzM (8/6/2014)
Here are a few options to make that single table "smaller":If the table contains a rather large number of columns (e.g. 50 or more) you might consider "vertical partitioning", meaning to add a second table with the same primary key and splitt the columns (if columns can be grouped logically, even better...).
If the size is due to a large number of rows, you might consider "horizontal partitioning",e.g. by moving "old data" to one or more archive table(s), e.g. one per year.
Finally, evaluate the data type used for the column definitions and if it's defined for the size needed. For example, a NCHAR(255) to store either "Yes" or "No" could be reduced to VARCHAR(3)...
Excellent points overall.
But a Yes/No column should be changed to char(3), not varchar(3) (barring lots of NULL values).
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
Viewing 15 posts - 1 through 15 (of 28 total)
You must be logged in to reply to this topic. Login to reply