Caching
When you execute an aggregation query, the node that receives the request sends the query to all the shards of the index. The results from each shard are gathered back and sent to the client. The aggregation results are cached at a shard level. Computing an aggregation is an expensive operation. Caching the response greatly improves the performance and reduces the strain on the system. Elasticsearch cache is smart and is automatically invalidated where there is new data. Since the cache is per shard, the cache is invalidated only for the shards that have new/modified data. Starting Elasticsearch 5.0, the request cache is enabled by default. The query JSON is used as a key.
Cache greatly improves performance for indexes that have static ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access