Some time ago I started to suspect that my dgraph database took up to much disk space. So, I decided to perform some experiments. The results seem quite confusing to me and raise few questions.
In the beginning the size of the database was 39gb (p and w folders together). I exported it in an rdf file and then imported using bulk loader. Compression rate was 3 during the import (as it was before for dgraph-alpha by default). After the import the databased reduced to 29gb.
Why did it happen? What had dgraph stored in 10gb before import?
The rdf file is about 5gb gzipped and 31gb unpacked. Taking into account that compression is enabled by default and there are just 3 hash indices for string predicates I expect the database to be far less than 29gb. Why does it take up so much space?
I tried to set different compression levels during import from 1 up to 20 using parameter --badger.compression_level. In every case the database size is 29gb. Does this parameter work?