[citation][nom]Anonymous[/nom]because when you modify even just one byte of a file that is compressed, you can end up changing a significant portion of the file, not just that byte. it's good if you can fit the change in one block erase; what if you can't? you'll end up writing more info on the "disk" then.[/citation]
Changing bytes is not the only thing that can make every other bit of the file rewritten.
if you remove or add any single byte, the whole file will be rewritten after that point...
and this affects uncompressed files too.
What is the most common operation:
1) changing bytes?
binary files, with only fixed data
database files - they mostly change/append data
2) append only?
log files - logs are mostly append only files, until they reach max size
journal files - these are high-performance logs used in transactions
3) adding/removing bytes?
files changed by a humans fall into this category: txt, doc, xls, html, cs, vb, js, html... so on
non binary config files (even the ones edited by apps): xml, ini, and so on
4) just reading?
program files, OS files: exe, dll, bmp, png
user media: avi, png, mp3
Where the compression is good or not:
1) bad (increases total writes)
2) very good with simple-logs (reduces total writes)... but very bad with journal files
3) very good (reduces total writes)
4) good (but may have no effect on media files)
(It would be great if there was an app that knew how to classify files into these
categories and apply compression to them, or not)
There is even one other point:
applications are not forced to create compressed files if they don't want.
I think that SQL Server will created uncompressed mdf files when database is created
(or at least it will complain, don't remember exactly),
even if the folder has the check to compress files.