Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
inbs
Aged Yak Warrior
860 Posts |
Posted - 2009-09-24 : 02:49:30
|
shrink is risk to the data?do i need shrink every day? |
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2009-09-24 : 04:44:39
|
It's no risk to the data, but you shouldn't be shrinking on a regular basis at all.Why do you want to shrink anyway? Databases tend to grow as more data gets put in them. It's in their nature.Shrinking causes massive fragmentation and will just result in the data file growing again next time data gets added. When that happens, the entire system will slow down as the file is expanded. Also repeated shrinks and grows will cause fragmentation at the file-system level, which is hard to fix.See - [url]http://sqlinthewild.co.za/index.php/2007/09/08/shrinking-databases/[/url]--Gail ShawSQL Server MVP |
 |
|
inbs
Aged Yak Warrior
860 Posts |
Posted - 2009-09-24 : 05:21:43
|
thanks, i think like you.i dont see somethink like that in the article except about index.where can i find article from MSDN |
 |
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2009-09-24 : 08:26:06
|
Article on MSDN about what?--Gail ShawSQL Server MVP |
 |
|
inbs
Aged Yak Warrior
860 Posts |
Posted - 2009-09-24 : 08:32:47
|
about what you said. "Shrinking causes massive fragmentation" |
 |
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
|
inbs
Aged Yak Warrior
860 Posts |
Posted - 2009-09-25 : 10:15:20
|
GilaMonster ,in your post you write :There are cases where shrinking data files does make sense. When a process created lots of tables for processing then dropped them again, after a massive archiving job, after changing data types in a table to release a large amount of wasted space (more on that another time). Just be aware of the effect of a shrink on the fragmentation of indexes.if we delete and insert increment (around 50K rows) every dayso we need to shrink every day? |
 |
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2009-09-25 : 10:19:43
|
No, absolutely not. The case for shrink is when you've done a massive archiving job and do not expect the free space to be reused in a few months. Shrinking every day is an incredibly bad idea. Besides, 50k rows is a very small number. I was talking about archiving several million, resulting in many GB of free space. Not a few MB.Please read the post of Brent's that I linked to and all the posts that references.--Gail ShawSQL Server MVP |
 |
|
|
|
|
|
|