So I was recently running some benchmarks over a new index I built, where I set some fields to be stored in the index ("store":true), and set index.store.type: memory.
The expected behaviour was that there would be some overall speed improvement, which there was, and also that retrieving the fields that were now stored in the index would also be faster. This was also the case.
The thing I have no explanation for, is that aggregating over the fields that are now stored in the index, is faster than it should reasonably be. For the non-stored fields, aggregations were about 1.6x faster once I set the index to be stored in memory. However, for the stored fields, aggregations were 3.5x faster once i set the index to be stored in memory. My understanding is that aggregations work on the indexed data, and therefore setting store:true should garner no speed improvement. Is that not the case?
The only other explanation I can think of is that there is some property of the data in the stored fields that just happens to benefit MORE from the index being stored in memory than the other fields.