Compact SpatialDB as we go, not at the end