What is a typical Compression Ratio for an SQL Database backup file? [closed]

Solution 1:

It's impossible to answer this question without having even a small representative sample of the data in the database. If your DB is full of mpeg videos then even using PAQ isn't going to compress the data more than a few percent.

If your DB is full of the same byte repeated then it's going to compress to an extremely small size, maybe a ratio of 99.9% or better. Your data is probable somewhere inbetween, so it'll compress somewhere between 0.1% and 99.9%.

The backup industry likes to advertise that "most" data can be 50% compressed. I've found this to be optimistic, but not terribly far off. I've found our MSSQL DBs generally compress less than 30% however.

Solution 2:

This is tough to answer but I just did a dump today on one of my databases (running PostgreSQL 9.2:

select pg_size_pretty(pg_database_size('mydb'));       
pg_size_pretty 
----------------
5660 MB
(1 row)

And after the dump:

% ls -lh

-rw-r--r--  1 pgsql  pgsql   363M Mar  4 16:42 mydb-20130304.sql.gz

So that's a 93.5% decrease in size.