# Does \_split actually splits data or just copies it across shards

**URL:** https://discuss.elastic.co/t/does-split-actually-splits-data-or-just-copies-it-across-shards/315164
**Category:** Elasticsearch
**Created:** [September 26, 2022, 11:26am UTC](https://discuss.elastic.co/t/does-split-actually-splits-data-or-just-copies-it-across-shards/315164 "2022-09-26T11:26:12Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![danskiyq](https://avatars.discourse-cdn.com/v4/letter/d/c67d28/32.png) [@danskiyq](https://discuss.elastic.co/u/danskiyq)
#### Post date: [September 26, 2022, 11:26am UTC](https://discuss.elastic.co/t/does-split-actually-splits-data-or-just-copies-it-across-shards/315164/1 "2022-09-26T11:26:12Z")

</div>

I want to create a new index with bigger amount of shards and copy my data across. \_reindex would probably be the best solution, but I expected split to do what I wanted.  
So I have 38gb 1shard index and I wanted to split it into 4 shards index. I expected new index to have same amount of store.size and 4 shards, but instead store.size of a new index turned out to be 97gb, what's the reason behind it and how \_split actually works.

---

<div class="post-metadata">

### Author: ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)
#### Post date: [September 26, 2022, 12:02pm UTC](https://discuss.elastic.co/t/does-split-actually-splits-data-or-just-copies-it-across-shards/315164/2 "2022-09-26T12:02:31Z")

</div>

Hi Danyil,

The number of splits is determined by the index setting `index.number_of_routing_shards`. The docs entry [here](https://www.elastic.co/guide/en/elasticsearch/reference/8.4/indices-split-index.html#split-index-api-desc) include more details and examples that should help explain how splitting works.

Hope that helps.

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [September 26, 2022, 12:04pm UTC](https://discuss.elastic.co/t/does-split-actually-splits-data-or-just-copies-it-across-shards/315164/3 "2022-09-26T12:04:55Z")

</div>

I would recommend looking at the discusion in this [recent thread](https://discuss.elastic.co/t/how-does-elasticsearch-splitting-an-index-work/313319).

---

<div class="post-metadata">

### Author: ![danskiyq](https://avatars.discourse-cdn.com/v4/letter/d/c67d28/32.png) [@danskiyq](https://discuss.elastic.co/u/danskiyq)
#### Post date: [September 26, 2022, 3:24pm UTC](https://discuss.elastic.co/t/does-split-actually-splits-data-or-just-copies-it-across-shards/315164/5 "2022-09-26T15:24:53Z")

</div>

I understand the concept, but it's still confusing to me.  
In a nutshell, if I split 1shard index into 4 shards index, does it split that shard's data or instead copies it across all those newly created shards?

---

<div class="post-metadata">

### Author: ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)
#### Post date: [September 26, 2022, 3:50pm UTC](https://discuss.elastic.co/t/does-split-actually-splits-data-or-just-copies-it-across-shards/315164/6 "2022-09-26T15:50:13Z")

</div>

[Looking at this answer in another thread](https://discuss.elastic.co/t/cloned-split-indexes-take-double-disk-space-when-increasing-shards/254342/4), which is referenced in the discussion posted by @Christian_Dahlqvist, the shards are cloned and then docs are deleted in a similar way to delete by query.

The thread referenced above does walk through an example which may help explain further.

---

<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: [October 24, 2022, 3:50pm UTC](https://discuss.elastic.co/t/does-split-actually-splits-data-or-just-copies-it-across-shards/315164/7 "2022-10-24T15:50:58Z")

</div>

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