# Most efficient way to get all ids of a type

**URL:** <https://discuss.elastic.co/t/most-efficient-way-to-get-all-ids-of-a-type/47111>\
**Category:** Elasticsearch\
**Created:** [April 12, 2016, 11:07am UTC](https://discuss.elastic.co/t/most-efficient-way-to-get-all-ids-of-a-type/47111 "2016-04-12T11:07:47Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [April 12, 2016, 11:35am UTC](https://discuss.elastic.co/t/most-efficient-way-to-get-all-ids-of-a-type/47111/3 "2016-04-12T11:35:29Z")

</div>

But it is good to remember that this isn't what Elasticsearch is good at - those \_ids are stored with the \_source so they can be slower to fetch. Elasticsearch's aggregations are fast because they use a column store (doc values). \_id doesn't have that.

If performance is good enough for you then it is fine, but if it isn't then you are often better off thinking of reworking what you want to do as some kind of aggregation.

---

_[View the full topic](https://discuss.elastic.co/t/most-efficient-way-to-get-all-ids-of-a-type/47111)._
