# How are buckets stored within shard?

**URL:** <https://discuss.elastic.co/t/how-are-buckets-stored-within-shard/142061>\
**Category:** Elasticsearch\
**Created:** [July 29, 2018, 10:28am UTC](https://discuss.elastic.co/t/how-are-buckets-stored-within-shard/142061 "2018-07-29T10:28:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jose\_Ramierez](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@Jose\_Ramierez](https://discuss.elastic.co/u/Jose_Ramierez)\
**Post date:** [July 29, 2018, 10:28am UTC](https://discuss.elastic.co/t/how-are-buckets-stored-within-shard/142061/1 "2018-07-29T10:28:41Z")

</div>

We are looking to use buckets as our "primary key" (e.g. to keep all documents for a given account together, in one shard).

As a single shard will probably have a million or more documents, spanning 50-500 accounts, we are concerned with optimizing queries (e.g. minimizing the IO required to serve a query).

Where can we find information about how buckets are stored within the shard?

Thank you!

---

<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:** [August 26, 2018, 10:28am UTC](https://discuss.elastic.co/t/how-are-buckets-stored-within-shard/142061/2 "2018-08-26T10:28:42Z")

</div>

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