Instant Aggregations: Rewriting Queries for fun and profit
Blog post from Elastic
Colin Goodheart-Smithe discusses enhancements made to Elasticsearch's request cache feature, specifically focusing on its performance improvements for analytics use cases. Initially introduced in version 1.4.0, the request cache was disabled by default until version 5.0 due to its limited utility for computationally heavy queries with varying time windows. By refactoring the search request representation and implementing query rewriting, Elasticsearch can now effectively use the request cache, significantly accelerating search performance on repeated queries over static indices. The post highlights the process of rewriting queries to optimize cache usage, particularly for time series data, leading to dramatic reductions in query execution time, as illustrated with a UK house sales dataset. These improvements demonstrate the potential for further enhancements to query and aggregation caching strategies, promising even more substantial performance gains in future iterations.