Keep an internal counter of the underlying datafile size to compact it when it grows too big