Bird
Raised Fist0

You have a slow Elasticsearch search query using multiple wildcard patterns. Which change will most likely improve performance?

medium📝 Debug Q6 of Q15
Elasticsearch - Performance and Scaling
You have a slow Elasticsearch search query using multiple wildcard patterns. Which change will most likely improve performance?
AReplace wildcard queries with prefix queries where possible
BIncrease the number of shards for the index
CUse script queries instead of wildcard
DDisable caching for the query
Step-by-Step Solution
Solution:
  1. Step 1: Analyze wildcard query performance

    Wildcard queries are expensive, especially with leading wildcards.
  2. Step 2: Use prefix queries for better performance

    Prefix queries are faster because they only match from the start of terms.
  3. Final Answer:

    Replace wildcard queries with prefix queries where possible -> Option A
  4. Quick Check:

    Prefix queries faster than wildcards [OK]
Quick Trick: Use prefix queries instead of wildcards for speed [OK]
Common Mistakes:
MISTAKES
  • Increasing shards without need
  • Using script queries which are slower
  • Disabling caching reduces performance

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes