# Term aggregation with \_uid field loads all \_uid in fielddata =\> circuitBreakingExcep

**URL:** <https://discuss.elastic.co/t/term-aggregation-with--uid-field-loads-all--uid-in-fielddata-circuitbreakingexcep/32668>\
**Category:** Elasticsearch\
**Created:** [October 21, 2015, 12:05pm UTC](https://discuss.elastic.co/t/term-aggregation-with--uid-field-loads-all--uid-in-fielddata-circuitbreakingexcep/32668 "2015-10-21T12:05:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![iulianlaz](https://avatars.discourse-cdn.com/v4/letter/i/e95f7d/32.png) [@iulianlaz](https://discuss.elastic.co/u/iulianlaz)\
**Post date:** [October 21, 2015, 12:05pm UTC](https://discuss.elastic.co/t/term-aggregation-with--uid-field-loads-all--uid-in-fielddata-circuitbreakingexcep/32668/1 "2015-10-21T12:05:31Z")

</div>

Hello,

Let assume that I have an index (conversation) with 2 types: conversation (60 documents) and message (600 milions documents).

If I made an aggregation with field: \_uid, I am not sure if es loads the values from every document in conversation index or just from conversation/conversation (where query is made).

Expectation:  
I expect that only \_uids from conversation type to be loaded into fielddata, not the ones from message type too.

Actual result:  
I receive a circuitBreaker exception for this request, and I assume that message \_uids are loaded into fielddata too.

Request:

```
GET conversation/conversation/_search
{
  "size": 1,
  "aggs": {
    "threads": {
      "terms": {
        "field": "_uid",
        "size": 0
      }
    }
  }
}

```

Response:

```
"reason": "RemoteTransportException[[es2.novalocal][inet[/192.168.22.192:9300]][indices:data/read/search[phase/query]]]; nested: ElasticsearchException[org.elasticsearch.common.breaker.CircuitBreakingException: [FIELDDATA] Data too large, data for field [_uid] would be larger than limit of [10266083328/9.5gb]];

```

So, my question is: all documents from conversation index are loaded, not the one from conversation type?

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [October 22, 2015, 3:20pm UTC](https://discuss.elastic.co/t/term-aggregation-with--uid-field-loads-all--uid-in-fielddata-circuitbreakingexcep/32668/2 "2015-10-22T15:20:12Z")

</div>

> [@iulianlaz](#):
>
> 0]][indices:data/read/search[phase/query]]]; nested: ElasticsearchException[org.elasticsearch.common.breaker.CircuitBreakingException: [FIELDDATA] Data too large, data for field [\_uid] would be larg

This is the old "multiple indexes or multiple-types-in-an-index" question.  
From a management perspective (backup, restore, aliasing etc) it might make sense to have a single index but what you are seeing is one of the inefficiencies of storing multiple types in the same index. Some data structures used internally in an index are a function of the number of documents, regardless of type. This then is an argument for breaking the types out into a separate index.

---

<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 5, 2017, 11:43pm UTC](https://discuss.elastic.co/t/term-aggregation-with--uid-field-loads-all--uid-in-fielddata-circuitbreakingexcep/32668/3 "2017-07-05T23:43:11Z")

</div>


