---
title: Data retention overview | Tiger Data Docs
description: TimescaleDB API reference for data retention. Includes SQL functions for adding and removing data retention policies that run on a schedule that you define
---

Community

An intrinsic part of time-series data is that new data is accumulated and old data is rarely, if ever, updated. This means that the relevance of the data diminishes over time. It is therefore often desirable to delete old data to save disk space.

With TimescaleDB, you can manually remove old chunks of data or implement policies using these APIs.

For more information about creating a data retention policy, see the [data retention section](/docs/build/data-management/data-retention/create-a-retention-policy/index.md).

## Samples

### Create a data retention policy to discard chunks greater than 6 months old

```
SELECT add_retention_policy('conditions', drop_after => INTERVAL '6 months');
```

When you call `drop_after`, the time data range present in the partitioning time column is used to select the target chunks.

### Create a data retention policy with an integer-based time column

```
SELECT add_retention_policy('conditions', drop_after => BIGINT '600000');
```

### Create a data retention policy to discard chunks created before 6 months

```
SELECT add_retention_policy('conditions', drop_created_before => INTERVAL '6 months');
```

When you call `drop_created_before`, chunks created 3 months ago are selected.

### Remove a retention policy

```
SELECT remove_retention_policy('conditions');
```

Removes the existing data retention policy for the `conditions` table.

## Available functions

- [`add_retention_policy()`](/docs/reference/timescaledb/data-retention/add_retention_policy/index.md): create a policy to drop chunks older than a given interval
- [`remove_retention_policy()`](/docs/reference/timescaledb/data-retention/remove_retention_policy/index.md): remove a policy to drop chunks of a particular hypertable
