Understanding segments: are segments queried concurrently?

I was reading about shard sizing and best practices (How many shards should I have in my Elasticsearch cluster? | Elastic Blog) , 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: Dynamically Updatable Indices | Elasticsearch: The Definitive Guide [2.x] | Elastic

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.