# Ordering unsorted dataset with network shuffle

**URL:** <https://discuss.hail.is/t/ordering-unsorted-dataset-with-network-shuffle/1647>\
**Category:** Hail Query & hailctl\
**Created:** [September 11, 2020, 11:09am UTC](https://discuss.hail.is/t/ordering-unsorted-dataset-with-network-shuffle/1647 "2020-09-11T11:09:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nonchev](https://avatars.discourse-cdn.com/v4/letter/n/54ee81/32.png) [@nonchev](https://discuss.hail.is/u/nonchev)\
**Post date:** [September 11, 2020, 11:09am UTC](https://discuss.hail.is/t/ordering-unsorted-dataset-with-network-shuffle/1647/1 "2020-09-11T11:09:55Z")

</div>

Hello,

While I am working with MatrixTable, I am getting the message:

> 2020-09-11 13:05:25 Hail: INFO: Ordering unsorted dataset with network shuffle  
> 2020-09-11 13:05:25 Hail: INFO: Ordering unsorted dataset with network shuffle  
> 2020-09-11 13:05:37 Hail: INFO: Ordering unsorted dataset with network shuffle

Does this mean that the MatrixTable is being sorted after every operation? How can I disable this in order to optimise my code, because I do not need the MatrixTable to be ordered? Is it possible?

Thanks,

---

<div class="post-metadata">

**Author:** ![tpoterba](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/tpoterba/32/61_2.png) [@tpoterba](https://discuss.hail.is/u/tpoterba)\
**Post date:** [September 11, 2020, 2:03pm UTC](https://discuss.hail.is/t/ordering-unsorted-dataset-with-network-shuffle/1647/2 "2020-09-11T14:03:08Z")

</div>

Hail joins are executed using ordered merges, and a network shuffle is the implementation strategy to order unsorted datasets. It’s impossible to avoid every shuffle, but if you’re seeing messages like this a lot, it’s probably a good idea to insert a write/read after a key\_by or import or other expensive operation:

```auto
path = '/some/file'
mt.write(path)
mt = hl.read_matrix_table(path)

```

The method `checkpoint` is shorter syntax for the above:

```auto
mt = mt.checkpoint('/some/file')

```

---

<div class="post-metadata">

**Author:** ![nonchev](https://avatars.discourse-cdn.com/v4/letter/n/54ee81/32.png) [@nonchev](https://discuss.hail.is/u/nonchev)\
**Post date:** [September 11, 2020, 2:09pm UTC](https://discuss.hail.is/t/ordering-unsorted-dataset-with-network-shuffle/1647/3 "2020-09-11T14:09:30Z")

</div>

Ok, I will try
