Use index lookups instead of mapreduce in various places.