# Bulk copying edges concerns

**URL:** <https://discuss.dgraph.io/t/bulk-copying-edges-concerns/6231>\
**Category:** Dgraph\
**Tags:** mutation\
**Created:** [April 1, 2020, 8:27pm UTC](https://discuss.dgraph.io/t/bulk-copying-edges-concerns/6231 "2020-04-01T20:27:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vtomar](https://avatars.discourse-cdn.com/v4/letter/v/f05b48/32.png) [@vtomar](https://discuss.dgraph.io/u/vtomar)\
**Post date:** [April 1, 2020, 8:27pm UTC](https://discuss.dgraph.io/t/bulk-copying-edges-concerns/6231/1 "2020-04-01T20:27:00Z")

</div>

I need to copy edges from one node to another. This is what my mutation looks like.  
len(pUid) could be in millions, are there any known concerns with running such large number of mutations in single transaction?

```auto
upsert {
  query {
        qx(func: type(A)) @filter(uid_in(~p, "0x17954")) {
          pUid as uid
        }
  } 
  mutation @if(gt(len(pUid), 0)) {
  set {
      <0x17959> <p> uid(pUid) .
	  }
  }
}

```

Is there any upper limit to number of mutations in single transaction? Is it preferred to run this in batches of small size (X) ?

```auto
upsert {
  query {
        qx(func: type(A), offset: 0, first: X) @filter(uid_in(~p, "0x17954")) {
          pUid as uid
        }
  } 
  mutation @if(gt(len(pUid), 0)) {
  set {
      <0x17959> <p> uid(pUid) .
	  }
  }
}

```

---

<div class="post-metadata">

**Author:** ![MichelDiz](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/micheldiz/32/11873_2.png) [@MichelDiz](https://discuss.dgraph.io/u/MichelDiz)\
**Post date:** [April 1, 2020, 11:34pm UTC](https://discuss.dgraph.io/t/bulk-copying-edges-concerns/6231/2 "2020-04-01T23:34:29Z")

</div>

> [@vtomar](#):
>
> Is it preferred to run this in batches of small size (X) ?

That’s the best practice. If you don’t have enough resources you should limit your transactions.
