# Segment vs. Documents of multiple Types

**URL:** <https://discuss.elastic.co/t/segment-vs-documents-of-multiple-types/74649>\
**Category:** Elasticsearch\
**Created:** [February 10, 2017, 12:27pm UTC](https://discuss.elastic.co/t/segment-vs-documents-of-multiple-types/74649 "2017-02-10T12:27:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![doremon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/doremon/32/7837_2.png) [@doremon](https://discuss.elastic.co/u/doremon)\
**Post date:** [February 10, 2017, 12:27pm UTC](https://discuss.elastic.co/t/segment-vs-documents-of-multiple-types/74649/1 "2017-02-10T12:27:46Z")

</div>

Hi,

as per my understanding **Shards** are assigned to an **Index**. One index can have multiple **Types** holding number of _Documents_ inside. Every Shard have **Segments** which actually store the **Documents** inside its data structures.

Now, my Question is that does a Shard stores documents of all the Types of the index in a mixed state? So, if I have 6 Types defined with each having 1 Million documents and I want to perform a query that is only related to 1 of the type documents, will the search cover all 6 Million documents to return the results?

If yes then how can I avoid this waste of resources? Should I build more individual indices instead of putting many types inside an index?

---

<div class="post-metadata">

**Author:** ![ywelsch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ywelsch/32/7751_2.png) [@ywelsch](https://discuss.elastic.co/u/ywelsch)\
**Post date:** [February 10, 2017, 12:35pm UTC](https://discuss.elastic.co/t/segment-vs-documents-of-multiple-types/74649/2 "2017-02-10T12:35:54Z")

</div>

This should answer your questions and explain the tradeoffs:

> **[Index vs. Type
	  	 | Elastic](https://www.elastic.co/blog/index-vs-type)**
>
> Editor's Note (January 5, 2018): This article now contains outdated information. Please reference our documentation about the removal of types. Thank you. Who has never wondered whether new data shoul...

---

<div class="post-metadata">

**Author:** ![doremon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/doremon/32/7837_2.png) [@doremon](https://discuss.elastic.co/u/doremon)\
**Post date:** [February 10, 2017, 12:40pm UTC](https://discuss.elastic.co/t/segment-vs-documents-of-multiple-types/74649/3 "2017-02-10T12:40:00Z")

</div>

Love you bro!

---

<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 10, 2017, 12:40pm UTC](https://discuss.elastic.co/t/segment-vs-documents-of-multiple-types/74649/4 "2017-03-10T12:40:01Z")

</div>

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