# Whenever I index the data, index size is different even though I set the same config and mapping

**URL:** https://discuss.elastic.co/t/whenever-i-index-the-data-index-size-is-different-even-though-i-set-the-same-config-and-mapping/17612
**Category:** Elasticsearch
**Created:** [May 20, 2014, 6:39am UTC](https://discuss.elastic.co/t/whenever-i-index-the-data-index-size-is-different-even-though-i-set-the-same-config-and-mapping/17612 "2014-05-20T06:39:36Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Telax](https://avatars.discourse-cdn.com/v4/letter/t/d26b3c/32.png) [@Telax](https://discuss.elastic.co/u/Telax)
#### Post date: [May 20, 2014, 6:39am UTC](https://discuss.elastic.co/t/whenever-i-index-the-data-index-size-is-different-even-though-i-set-the-same-config-and-mapping/17612/1 "2014-05-20T06:39:36Z")

</div>

I would expect that it is because data is being distributed among shards and nodes differently automatically as you're using randomly generated ID's for your documents. Compression levels will always vary depending upon the data - you could have 100 consecutive rows with almost identical data giving good compression on one run but the next run they could be highly fragmented.

--  
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/f5afa243-fce5-4a27-9d5c-625e5fd5b9fe%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f5afa243-fce5-4a27-9d5c-625e5fd5b9fe%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)
#### Post date: [May 20, 2014, 8:26am UTC](https://discuss.elastic.co/t/whenever-i-index-the-data-index-size-is-different-even-though-i-set-the-same-config-and-mapping/17612/2 "2014-05-20T08:26:22Z")

</div>

Have you set up shards = 1 / replica = 0 for your index to disable random  
shard distribution by doc ID, and did you execute curl  
'0:9200/yourindexname/\_optimize?max\_num\_segments=1' after indexing to pack  
all segments?

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

Then you should see comparable results.

Jörg

On Tue, May 20, 2014 at 3:23 AM, [ellie.suh@nexr.com](mailto:ellie.suh@nexr.com) wrote:

> whenever I index the data, index size is different even though I set the  
> same config and mapping.  
> What happen to Elastic Search? Anybody knows about it? Please give me  
> hint...
> 
> 1. 
> 
> - tokenizer : standard
> - index compression : true
> - size of index : 2.78G
> 
> 1. 
> 
> - tokenizer : standard
> - index compression : true
> - size of index : 3.00G
> 
> 3
> 
> - tokenizer : standard
> - index compression : true
> - size of index : 2.89G
> 
> ==============================  
> 1.
> 
> - tokenizer : standard
> - source compression : true
> - size of index : 3.12G
> 
> 1. 
> 
> - tokenizer : standard
> - source compression : true
> - size of index : 2.76G
> 
> 1. 
> 
> - tokenizer : standard  
> -source compression : true
> - size of index : 2.91G
> 
> --  
> 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/e7c2c32f-5521-4b32-8dfb-96de0dc225eb%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e7c2c32f-5521-4b32-8dfb-96de0dc225eb%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/e7c2c32f-5521-4b32-8dfb-96de0dc225eb%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/e7c2c32f-5521-4b32-8dfb-96de0dc225eb%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/CAKdsXoFPqu3MrMi6Og1BYr99WuX%2B26J5d2T5fni-g%2BnNXnHTgg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoFPqu3MrMi6Og1BYr99WuX%2B26J5d2T5fni-g%2BnNXnHTgg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![jihyun\_suh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jihyun_suh/32/1551_2.png) [@jihyun\_suh](https://discuss.elastic.co/u/jihyun_suh)
#### Post date: [May 21, 2014, 8:22am UTC](https://discuss.elastic.co/t/whenever-i-index-the-data-index-size-is-different-even-though-i-set-the-same-config-and-mapping/17612/3 "2014-05-21T08:22:27Z")

</div>

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: [July 6, 2017, 1:27am UTC](https://discuss.elastic.co/t/whenever-i-index-the-data-index-size-is-different-even-though-i-set-the-same-config-and-mapping/17612/4 "2017-07-06T01:27:56Z")

</div>


