Challenge - 5 Problems
Cache Mastery in Elasticsearch
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
What is the output of this Elasticsearch query cache stats request?
Given the following request to check query cache statistics, what will be the value of
query_cache.memory_size_in_bytes if no queries have been cached yet?Elasticsearch
GET /_nodes/stats/query_cache
Attempts:
2 left
💡 Hint
Think about what the cache size would be before any queries are cached.
✗ Incorrect
When no queries are cached, the memory size used by the query cache is zero bytes.
🧠 Conceptual
intermediate1:30remaining
Which cache type is cleared when a document is updated in Elasticsearch?
In Elasticsearch, when you update a document, which cache is automatically cleared to ensure fresh results?
Attempts:
2 left
💡 Hint
Think about which cache holds field values used for sorting and aggregations.
✗ Incorrect
Field data cache is cleared on document updates because it holds in-memory field values that may change.
❓ Predict Output
advanced2:00remaining
What is the output of this request cache usage query?
Consider this request to check the request cache stats for an index. What is the value of
hit_count if the cache was never used?Elasticsearch
GET /my_index/_stats/request_cache
Attempts:
2 left
💡 Hint
If the cache was never hit, the hit count should be zero.
✗ Incorrect
Hit count starts at zero and increments when cache hits occur.
🔧 Debug
advanced2:30remaining
Why does this query cache not improve performance?
You enabled query cache on an index, but queries are not being cached. Which of the following reasons explains this behavior?
Elasticsearch
GET /my_index/_search
{
"query": {
"match_all": {}
},
"request_cache": true
}Attempts:
2 left
💡 Hint
Request cache works only for certain query types.
✗ Incorrect
Request cache caches filter context queries, not full queries like match_all.
🚀 Application
expert3:00remaining
How to reduce field data cache memory usage for a large text field?
You have a large text field used for sorting and aggregations causing high field data cache memory usage. Which approach will reduce memory usage effectively?
Attempts:
2 left
💡 Hint
Doc_values store field data on disk in a columnar format, reducing heap usage.
✗ Incorrect
Enabling doc_values stores field data on disk, reducing heap memory usage compared to fielddata cache.