# Lower latency by using more shards (with routing)

**URL:** <https://discuss.elastic.co/t/lower-latency-by-using-more-shards-with-routing/325117>\
**Category:** Elasticsearch\
**Created:** [February 9, 2023, 9:25am UTC](https://discuss.elastic.co/t/lower-latency-by-using-more-shards-with-routing/325117 "2023-02-09T09:25:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![frankkoornstra](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/frankkoornstra/32/6780_2.png) [@frankkoornstra](https://discuss.elastic.co/u/frankkoornstra)\
**Post date:** [February 9, 2023, 9:25am UTC](https://discuss.elastic.co/t/lower-latency-by-using-more-shards-with-routing/325117/1 "2023-02-09T09:25:47Z")

</div>

Hey,

I'm trying to lower the search latency for an index which has _routing enabled_ (and we consistently use it for all queries) and I was wondering if increasing the amount of shards would do the trick? We're deployed on Elastic Cloud in 3 zones.

My reasoning for this: with routing we already go to 1 shard so there's no overhead (when searching) if the amount of shards increases. On the other hand, each shard would be smaller, which (in my mind but please correct me if I'm wrong) means ES has to go through less data, thus making the search faster.

Any experts that can confirm or deny this suspicion?

Thanks!

---

<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:** [February 9, 2023, 9:32am UTC](https://discuss.elastic.co/t/lower-latency-by-using-more-shards-with-routing/325117/2 "2023-02-09T09:32:56Z")

</div>

If you are consistently using routing for queries, latency can be reduced by increasing the number of primary shards as you described, at least as long as you have a reasonably large number of routing keys and a fairly even distribution of data across these so shards end up evenly sized wthout hotspots. It may however slow down queries hitting more than a single shard.

---

<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:** [March 9, 2023, 9:33am UTC](https://discuss.elastic.co/t/lower-latency-by-using-more-shards-with-routing/325117/3 "2023-03-09T09:33:54Z")

</div>

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