Understanding segments: are segments queried concurrently?

I was reading about shard sizing and best practices (https://www.elastic.co/blog/how-many-shards-should-i-have-in-my-elasticsearch-cluster) , and understood that having fewer, larger segments, can improve query performance:

TIP: As the overhead per shard depends on the segment count and size, forcing smaller segments to merge into larger ones through a forcemerge operation can reduce overhead and improve query performance. This should ideally be done once no more data is written to the index. Be aware that this is an expensive operation that should ideally be performed during off-peak hours.

However, according to: https://www.elastic.co/guide/en/elasticsearch/guide/current/dynamic-indices.html

When a query is issued, all known segments are queried in turn

Are segments queried concurrently? if so- wouldn't it make to want more segments in the shard?

I believe segments are queried sequentially as a single thread is used per shard for each query. Fewer segments can therefore improve performance.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.