implement xdb database shrinking