# Filtering is really fast but show is really slow, why is that?

**URL:** <https://discuss.hail.is/t/filtering-is-really-fast-but-show-is-really-slow-why-is-that/1471>\
**Category:** Hail Query & hailctl\
**Created:** [June 11, 2020, 9:56pm UTC](https://discuss.hail.is/t/filtering-is-really-fast-but-show-is-really-slow-why-is-that/1471 "2020-06-11T21:56:58Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![danking](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/danking/32/43_2.png) [@danking](https://discuss.hail.is/u/danking)\
**Post date:** [June 19, 2020, 3:11pm UTC](https://discuss.hail.is/t/filtering-is-really-fast-but-show-is-really-slow-why-is-that/1471/2 "2020-06-19T15:11:42Z")

</div>

Hail only performs computation the first time you observe the output, such as with collect, show, or write. When you evaluate

```auto
mt_f1 = mt.filter(...)

```

Hail does not process the data. Instead, Hail is building a recipe of things that need to be done in order to give you the results you want. Conceptually, `mt_f1` is:

1. Read the table from gs://gnomad-public…, call this mt
2. Filter mt by using the values from genes\_as\_hail\_literal

It is only at the time that you execute:

```auto
mt_f1.show()

```

that Hail actually executes the recipe you’ve built. If you execute:

```auto
mt_f1.show()
mt_f1.show()

```

Then Hail will run the entire recipe _twice_. Hail is designed this way because it operates on data that is too large to fit in memory. Hail is like a firehose, either the water is shooting out into something or it is off. There’s no way to pause the firehose half-way through a computation.

---

_[View the full topic](https://discuss.hail.is/t/filtering-is-really-fast-but-show-is-really-slow-why-is-that/1471)._
