Optimization of the get_region_start_and_end_indices() function. The former method of building up a list of indices was slow and required alot of memory, so we switched to a method that exploits the fact that the datasets are sorted.  We also disabled indexing, which for some reason decreased the query performance (we will investigate this further).