# Understanding segments: are segments queried concurrently?

**URL:** <https://discuss.elastic.co/t/understanding-segments-are-segments-queried-concurrently/262239>\
**Category:** Elasticsearch\
**Created:** [January 26, 2021, 2:19pm UTC](https://discuss.elastic.co/t/understanding-segments-are-segments-queried-concurrently/262239 "2021-01-26T14:19:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gkman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gkman/32/74525_2.png) [@gkman](https://discuss.elastic.co/u/gkman)\
**Post date:** [January 26, 2021, 2:19pm UTC](https://discuss.elastic.co/t/understanding-segments-are-segments-queried-concurrently/262239/1 "2021-01-26T14:19:49Z")

</div>

I was reading about shard sizing and best practices ([How many shards should I have in my Elasticsearch cluster? | Elastic Blog](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](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-forcemerge.html) 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](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?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [January 27, 2021, 8:03am UTC](https://discuss.elastic.co/t/understanding-segments-are-segments-queried-concurrently/262239/2 "2021-01-27T08:03:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 24, 2021, 8:03am UTC](https://discuss.elastic.co/t/understanding-segments-are-segments-queried-concurrently/262239/3 "2021-02-24T08:03:52Z")

</div>

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