# About replica shard use many field data

**URL:** <https://discuss.elastic.co/t/about-replica-shard-use-many-field-data/23532>\
**Category:** Elasticsearch\
**Created:** [May 4, 2015, 8:50am UTC](https://discuss.elastic.co/t/about-replica-shard-use-many-field-data/23532 "2015-05-04T08:50:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Junheng\_Gong](https://avatars.discourse-cdn.com/v4/letter/j/f1d935/32.png) [@Junheng\_Gong](https://discuss.elastic.co/u/Junheng_Gong)\
**Post date:** [May 4, 2015, 8:50am UTC](https://discuss.elastic.co/t/about-replica-shard-use-many-field-data/23532/1 "2015-05-04T08:50:38Z")

</div>

we have about 2.2B data in our elasticsearch, and we using facet and  
function score query on those data.

it will load many data to fielddata, and replica double it.

so my question is "how to set replica to make sure it won't use field data  
expect primary shard down"?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/83db33a6-0248-42eb-b913-8da49a45006f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/83db33a6-0248-42eb-b913-8da49a45006f%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 4, 2015, 9:47am UTC](https://discuss.elastic.co/t/about-replica-shard-use-many-field-data/23532/2 "2015-05-04T09:47:51Z")

</div>

Replica's don't double the amount of field data loaded. A query will only  
load what it needs from the shards it needs, but it won't load primary and  
replica, just one or the other.

Ideally you should 1) upgrade to aggs, facets are deprecated and not as  
performant, and 2) upgrade to doc\_values.

On 4 May 2015 at 18:50, Junheng Gong [lunadancer@gmail.com](mailto:lunadancer@gmail.com) wrote:

> we have about 2.2B data in our elasticsearch, and we using facet and  
> function score query on those data.
> 
> it will load many data to fielddata, and replica double it.
> 
> so my question is "how to set replica to make sure it won't use field data  
> expect primary shard down"?
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/83db33a6-0248-42eb-b913-8da49a45006f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/83db33a6-0248-42eb-b913-8da49a45006f%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/83db33a6-0248-42eb-b913-8da49a45006f%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/83db33a6-0248-42eb-b913-8da49a45006f%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAEYi1X9ag56CtN%3D%3DnkMdNqfUfeOxgNEDTnKQ1LXtDZw%3DRuhzhw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEYi1X9ag56CtN%3D%3DnkMdNqfUfeOxgNEDTnKQ1LXtDZw%3DRuhzhw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Junheng\_Gong](https://avatars.discourse-cdn.com/v4/letter/j/f1d935/32.png) [@Junheng\_Gong](https://discuss.elastic.co/u/Junheng_Gong)\
**Post date:** [May 4, 2015, 9:55am UTC](https://discuss.elastic.co/t/about-replica-shard-use-many-field-data/23532/3 "2015-05-04T09:55:07Z")

</div>

Thanks for you replay Mark,

"active": {  
"primaries": {  
"fielddata": {  
"memory\_size\_in\_bytes": 77076457764,  
"evictions": 0,  
"fields": {  
"commentsCount": {  
"memory\_size\_in\_bytes": 2416090508  
},  
"\_uid": {  
"memory\_size\_in\_bytes": 46517210860  
},  
"sourceTimeUnit": {  
"memory\_size\_in\_bytes": 4160954108  
},  
"likesCount": {  
"memory\_size\_in\_bytes": 4225460468  
},  
"imageCount": {  
"memory\_size\_in\_bytes": 435807840  
},  
"geo": {  
"memory\_size\_in\_bytes": 19320933980  
}  
}  
}  
},  
"total": {  
"fielddata": {  
"memory\_size\_in\_bytes": 90893341516,  
"evictions": 0,  
"fields": {  
"commentsCount": {  
"memory\_size\_in\_bytes": 2661775356  
},  
"\_uid": {  
"memory\_size\_in\_bytes": 55220225456  
},  
"sourceTimeUnit": {  
"memory\_size\_in\_bytes": 4846336504  
},  
"likesCount": {  
"memory\_size\_in\_bytes": 4712145912  
},  
"imageCount": {  
"memory\_size\_in\_bytes": 517060176  
},  
"geo": {  
"memory\_size\_in\_bytes": 22935798112  
}  
}  
}  
}  
},

we got field data usage by using GET /\_stats/fielddata?fields=\*

in this result total is more than primaries, so i thought maybe some  
replica load data to field data too. (cause some query will send to replica  
shard)

在 2015年5月4日星期一 UTC+8下午4:50:38，Junheng Gong写道：

> we have about 2.2B data in our elasticsearch, and we using facet and  
> function score query on those data.
> 
> it will load many data to fielddata, and replica double it.
> 
> so my question is "how to set replica to make sure it won't use field data  
> expect primary shard down"?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/8928f963-47c9-478f-acbb-5b594cd4a9ff%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8928f963-47c9-478f-acbb-5b594cd4a9ff%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 12:15am UTC](https://discuss.elastic.co/t/about-replica-shard-use-many-field-data/23532/4 "2017-07-06T00:15:56Z")

</div>

Closed on July 6, 2017, 12:15am UTC


