Optimization: combining position row caching with id caching for single data loop.