compact index.db and pagination.db if necessary