Some refactoring about index: 1. The find/equal_range operations for std::multimap seem to not be thread-safe. When parallel reads occur, one of them would return 0 result for existing elements. By changing the read lock to a write lock, the problem is gone. We may need to look into this case, as std::multimap claims it is read thread safe.
Some refactoring about index:
1. The find/equal_range operations for std::multimap seem to not be
thread-safe. When parallel reads occur, one of them would return 0
result for existing elements. By changing the read lock to a write lock,
the problem is gone. We may need to look into this case, as
std::multimap claims it is read thread safe.

2. When all scan key are using `equal` comparison, we should use
equal_range operations to find all associated values, as `find`
operation may return any of the valid answer and if we were to iterate the map
starting from that answer, some valid elements may be missed.

eric-haibin-lin/peloton,eric-haibin-lin/peloton,eric-haibin-lin/peloton,eric-haibin-lin/peloton,eric-haibin-lin/peloton,eric-haibin-lin/peloton,eric-haibin-lin/peloton