Optimization for spatial partition.