optimize spatial info query