# How to curb & delete history but keep workflows running?

**URL:** <https://community.temporal.io/t/how-to-curb-delete-history-but-keep-workflows-running/1042>\
**Category:** Community Support\
**Created:** [November 19, 2020, 6:53pm UTC](https://community.temporal.io/t/how-to-curb-delete-history-but-keep-workflows-running/1042 "2020-11-19T18:53:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hazcod](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/hazcod/32/206_2.png) [@hazcod](https://community.temporal.io/u/hazcod)\
**Post date:** [November 19, 2020, 6:53pm UTC](https://community.temporal.io/t/how-to-curb-delete-history-but-keep-workflows-running/1042/1 "2020-11-19T18:53:07Z")

</div>

Hi,

As per [https://temporalio.slack.com/archives/CTRCR8RBP/p1605352484031900](https://temporalio.slack.com/archives/CTRCR8RBP/p1605352484031900)

My temporal database is growing quite large. (1TB+)  
I’ve set the retention tot 0 using tctl: `tctl --ad temporal:7233 --ns mynamespace namespace update --retention 0`

However, the database size is still growing and I don’t want to impact cron and new workflows…  
Any help? Thanks!

---

<div class="post-metadata">

**Author:** ![samar](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/samar/32/12_2.png) [@samar](https://community.temporal.io/u/samar)\
**Post date:** [November 20, 2020, 5:37pm UTC](https://community.temporal.io/t/how-to-curb-delete-history-but-keep-workflows-running/1042/3 "2020-11-20T17:37:36Z")

</div>

Do you know the table which is taking most of the space?

Updating retention only applies to workflow executions which closes after the retention is updated. All workflow executions closed previously still need to wait on the timer based on previous retention policy for them to be deleted.

Another cause could be that we create a 10 year timer for each workflow timeout and potentially activity execution. Although these timers are tiny but they can add up if you are starting workflows/activities at a very high rate. We have a [PR](https://github.com/temporalio/temporal/pull/995) out to address this issue. Should be included in our next release.

---

<div class="post-metadata">

**Author:** ![hazcod](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/hazcod/32/206_2.png) [@hazcod](https://community.temporal.io/u/hazcod)\
**Post date:** [November 22, 2020, 2:23pm UTC](https://community.temporal.io/t/how-to-curb-delete-history-but-keep-workflows-running/1042/4 "2020-11-22T14:23:22Z")

</div>

Seems to be `temporal`, I guess it resized but won’t size back down:

```auto
temporal | 111 GB
 temporal_visibility | 17 GB

```

---

<div class="post-metadata">

**Author:** ![samar](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/samar/32/12_2.png) [@samar](https://community.temporal.io/u/samar)\
**Post date:** [November 22, 2020, 9:55pm UTC](https://community.temporal.io/t/how-to-curb-delete-history-but-keep-workflows-running/1042/5 "2020-11-22T21:55:14Z")

</div>

Can you provide further breakdown within the keyspace? What was your retention before you set it to 0? If the size came down then most probably retention timer for your old workflow executions have started to kick in. This would result in deleting all resources consumed by previous workflow executions.

Also can you make sure to set a reasonable timeout for workflow execution yourself until [PR](https://github.com/temporalio/temporal/pull/995) to address very long timer is merged and released.
