> For the complete documentation index, see [llms.txt](https://upsolver.gitbook.io/content/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://upsolver.gitbook.io/content/reference-1/monitoring/datasets/maintenance/expire-snapshots.md).

# Expire Snapshots

Snapshots in Iceberg tables represent consistent views of the table's data at a specific point in time. Each snapshot is created whenever changes are made to the table, such as adding, updating, or deleting data. These snapshots enable features like time travel, allowing users to query the table as it existed at a previous state.

Over time, as new snapshots are created, old ones may become irrelevant or redundant, consuming unnecessary storage. Snapshot expiration is the process of removing these outdated snapshots based on predefined policies, freeing up storage while maintaining the table's integrity and performance.

The *Expire Snapshots* tab lets you monitor the status of snapshot expiration in the table. It tracks the expiration process using the following parameters:

1. **history.expire.max-snapshot-age-ms**: The maximum age of snapshots to retain on the table and its branches during expiration.
2. **history.expire.min-snapshots-to-keep**: The minimum number of snapshots to retain on the table and its branches during expiration.

When the expire snapshots job runs, it checks for snapshots eligible for expiration based on these parameters. Once the job completes, the expired snapshots are deleted, and their storage is reclaimed.

<figure><img src="/files/ezhuSDOZESrHilRccCbj" alt=""><figcaption><p>Expire Snapshots Tab</p></figcaption></figure>

Per Snapshot Expiration Job run, you will be able to track the following KPIs:

<table><thead><tr><th width="290">Metric</th><th>Description</th></tr></thead><tbody><tr><td>Job Start time</td><td>The timestamp indicating when the snapshot expiration job started.</td></tr><tr><td>Status</td><td>The current status of the snapshot expiration job. Possible values include: "Running", "Completed", "Failed (Retrying)", "Failed".</td></tr><tr><td>Duration</td><td>The total run time duration of the job.</td></tr><tr><td>Snapshots Expired</td><td>The total number of snapshots that were expired during the job execution.</td></tr><tr><td>Latest Expired Snapshot </td><td>The timestamp of the most recent snapshot that was expired during the job.</td></tr><tr><td>Data Files Deleted</td><td>The total number of data files that were deleted as a result of expiring the snapshots.</td></tr><tr><td>Metadata files Deleted</td><td>The total number of metadata files that were deleted during the snapshot expiration process.</td></tr><tr><td>Storage Size Deleted </td><td>The total amount of storage space (in bytes) freed by deleting the expired snapshots, data files, and metadata files. </td></tr><tr><td>Errors</td><td>Errors text in case errors were detected.</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://upsolver.gitbook.io/content/reference-1/monitoring/datasets/maintenance/expire-snapshots.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
