# Search and aggregation performance of Byte vs Integer vs Long

**URL:** <https://discuss.elastic.co/t/search-and-aggregation-performance-of-byte-vs-integer-vs-long/163318>\
**Category:** Elasticsearch\
**Created:** [January 8, 2019, 8:46am UTC](https://discuss.elastic.co/t/search-and-aggregation-performance-of-byte-vs-integer-vs-long/163318 "2019-01-08T08:46:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dextermorgan](https://avatars.discourse-cdn.com/v4/letter/d/65b543/32.png) [@dextermorgan](https://discuss.elastic.co/u/dextermorgan)\
**Post date:** [January 8, 2019, 8:46am UTC](https://discuss.elastic.co/t/search-and-aggregation-performance-of-byte-vs-integer-vs-long/163318/1 "2019-01-08T08:46:08Z")

</div>

According to following article, we should use the smallest numeric datatype that fits the requirement.

[https://www.elastic.co/guide/en/elasticsearch/reference/5.4/number.html#\_which\_type\_should\_i\_use](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/number.html#_which_type_should_i_use)

I want to understand in more detail that why and how search speed would get improved? Also, would that speed up aggregations as well?

---

<div class="post-metadata">

**Author:** ![dextermorgan](https://avatars.discourse-cdn.com/v4/letter/d/65b543/32.png) [@dextermorgan](https://discuss.elastic.co/u/dextermorgan)\
**Post date:** [January 16, 2019, 12:05pm UTC](https://discuss.elastic.co/t/search-and-aggregation-performance-of-byte-vs-integer-vs-long/163318/2 "2019-01-16T12:05:49Z")

</div>

Can anyone answer this question?

Thanks

---

<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:** [February 13, 2019, 12:05pm UTC](https://discuss.elastic.co/t/search-and-aggregation-performance-of-byte-vs-integer-vs-long/163318/3 "2019-02-13T12:05:56Z")

</div>

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