# Records per shard

**URL:** <https://discuss.elastic.co/t/records-per-shard/24338>\
**Category:** Elasticsearch\
**Created:** [June 25, 2015, 1:23pm UTC](https://discuss.elastic.co/t/records-per-shard/24338 "2015-06-25T13:23:58Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheCowboy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thecowboy/32/501_2.png) [@TheCowboy](https://discuss.elastic.co/u/TheCowboy)\
**Post date:** [June 25, 2015, 1:23pm UTC](https://discuss.elastic.co/t/records-per-shard/24338/1 "2015-06-25T13:23:58Z")

</div>

Hi

What's the best practice/main thing to consider when deciding upon the number of shards in your index vs the number of documents you will have?

For example in our dev system we've had a problem highlighted here:

[https://www.elastic.co/guide/en/elasticsearch/guide/current/relevance-is-broken.html](https://www.elastic.co/guide/en/elasticsearch/guide/current/relevance-is-broken.html)

Is there a formula or "best practice guide" to consider when deciding this?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 26, 2015, 11:25pm UTC](https://discuss.elastic.co/t/records-per-shard/24338/2 "2015-06-26T23:25:54Z")

</div>

One shard per node is nice as then data is spread across them. However when taking things like relevance into account this obviously changes.

How big is your dataset?

---

<div class="post-metadata">

**Author:** ![TheCowboy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thecowboy/32/501_2.png) [@TheCowboy](https://discuss.elastic.co/u/TheCowboy)\
**Post date:** [June 29, 2015, 7:20am UTC](https://discuss.elastic.co/t/records-per-shard/24338/3 "2015-06-29T07:20:17Z")

</div>

At the moment we were developing only on 6-8 records, which I accept is hardly anything but we needed to incrementally build and understand the scoring system when we add/remove/edit records.

Going forward we expect it to be approx 147,000 documents.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 29, 2015, 8:06am UTC](https://discuss.elastic.co/t/records-per-shard/24338/4 "2015-06-29T08:06:38Z")

</div>

And how big are they?

---

<div class="post-metadata">

**Author:** ![TheCowboy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thecowboy/32/501_2.png) [@TheCowboy](https://discuss.elastic.co/u/TheCowboy)\
**Post date:** [July 7, 2015, 12:55pm UTC](https://discuss.elastic.co/t/records-per-shard/24338/5 "2015-07-07T12:55:38Z")

</div>

Sorry for the slow reply and excuse my ignorance but how could I find that?

EDIT: In sense I ran:

GET /IndexName/\_stats

And got:

"docs": {  
"count": 145261,  
"deleted": 0  
},  
"store": {  
"size\_in\_bytes": 23120808,  
"throttle\_time\_in\_millis": 95  
}

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [July 7, 2015, 11:02pm UTC](https://discuss.elastic.co/t/records-per-shard/24338/6 "2015-07-07T23:02:48Z")

</div>

You can also use the `_cat` API.

Given that size you should aim for a single shard. Otherwise check out [https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-search-type.html#dfs-query-then-fetch](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-search-type.html#dfs-query-then-fetch)

---

<div class="post-metadata">

**Author:** ![TheCowboy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thecowboy/32/501_2.png) [@TheCowboy](https://discuss.elastic.co/u/TheCowboy)\
**Post date:** [July 8, 2015, 7:33am UTC](https://discuss.elastic.co/t/records-per-shard/24338/7 "2015-07-08T07:33:18Z")

</div>

Thanks for your reply Mark, much appreciated. Would I be on the right track thinking there might be a performance impact with dfs-query-then-fetch? I guess it's a trade-off we would have to consider but for now I think it's easier for us to have 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:** [July 6, 2017, 12:02am UTC](https://discuss.elastic.co/t/records-per-shard/24338/8 "2017-07-06T00:02:57Z")

</div>


