Improving query performance

This section highlights common reasons behind certain slow queries on Elasticsearch, and offers instruction to improve performance.

High-cardinality fields

As previously mentioned, running aggregation or sorts against high-cardinality fields (for example, dates precise to the millisecond) can fill up the fielddata cache which leads to OutOfMemoryError exceptions. However, even without these errors, running aggregations and sorts can be detrimental to performance. When it comes to dates, it's generally a good idea to store and use less precise dates in order to speed up query execution time.

Querying smaller indices

As Elasticsearch indices grow larger, query performance will suffer. Another way to improve performance is ...

Get Monitoring Elasticsearch now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.