Fix #111 DB.compact() method fails with large data sets