Bird
Raised Fist0

An Elasticsearch query uses a terms filter with a very large list of values, causing slow performance. What is a recommended fix?

medium📝 Debug Q7 of Q15
Elasticsearch - Performance and Scaling
An Elasticsearch query uses a terms filter with a very large list of values, causing slow performance. What is a recommended fix?
AIncrease the refresh interval of the index
BDisable the filter cache
CAdd more replicas to the cluster
DUse a terms lookup mechanism instead of a large inline list
Step-by-Step Solution
Solution:
  1. Step 1: Understand terms filter with large lists

    Large inline lists in terms filter slow down query parsing and execution.
  2. Step 2: Use terms lookup for better performance

    Terms lookup fetches values from a document, reducing query size and improving speed.
  3. Final Answer:

    Use a terms lookup mechanism instead of a large inline list -> Option D
  4. Quick Check:

    Terms lookup improves large list filters [OK]
Quick Trick: Use terms lookup to handle large value lists efficiently [OK]
Common Mistakes:
MISTAKES
  • Increasing refresh interval unrelated to query speed
  • Adding replicas does not speed single query
  • Disabling filter cache reduces performance

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes