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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.