# How does Elasticsearch Splitting an Index Work?

**URL:** https://discuss.elastic.co/t/how-does-elasticsearch-splitting-an-index-work/313319
**Category:** Elasticsearch
**Created:** [August 31, 2022, 7:18am UTC](https://discuss.elastic.co/t/how-does-elasticsearch-splitting-an-index-work/313319 "2022-08-31T07:18:14Z")
**Posts on this page:** 1
**Showing post:** 10

<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 7, 2022, 7:52am UTC](https://discuss.elastic.co/t/how-does-elasticsearch-splitting-an-index-work/313319/10 "2022-09-07T07:52:55Z")

</div>

> [@Hao\_Yellow](#):
>
> Based on the understanding above, first of all the 100GB shards on node 3 will be copied 4 times, which add up to 400GB... So the first step, cloning, is a problem. Neither of the nodes can accommodate another 100GB, not to say 400GB.

It is indeed a problem and it is futher complicated as the delete by query will require a lot of additional disk space, as described in David's response:

> [@Cloned/Split Indexes Take Double Disk Space When Increasing Shards](https://discuss.elastic.co/t/cloned-split-indexes-take-double-disk-space-when-increasing-shards/254342/4):
>
> Splitting the index works by cloning all the shards (multiple times) and then effectively running a delete-by-query on them, which certainly increases the reported size until merging cleans up the deleted docs.

> [@Hao\_Yellow](#):
>
> And what about shard allocation? This process may be implicit in the cloning. If the operation is clone and delete-by-query, what will happen if neither nodes are not sufficient to contain the original shard of 100GB before delete-by-query?

I do not think the new shards can get allocated to another node until the delete by query has completed on the original node. Either way it does not work as transferring a 100GB before delete by query runs is not possible.

> [@Hao\_Yellow](#):
>
> But I guess it's supposed to work anyway? And Elasticsearch is intelligent enough to work that out?

No. Splitting an index without the required additional disk space will not work.

---

_[View the full topic](https://discuss.elastic.co/t/how-does-elasticsearch-splitting-an-index-work/313319)._
