---
title: "Lakehouse - Managing table maintenance"
description: "Find out how to enable the maintenance operations of your Lakehouse tables, set their policy at each level, follow their status and read their run history"
url: https://docs.ovhcloud.com/pl/guides/public-cloud/data-analytics/lakehouse/lakehouse-table-maintenance
lang: en
lastUpdated: 2026-12-01
---
> For AI agents: the complete documentation index is available at https://docs.ovhcloud.com/pl/llms.txt, the full documentation bundle is available at https://docs.ovhcloud.com/pl/llms-full.txt.

# Lakehouse - Managing table maintenance

**Warning:** Lakehouse is in alpha. It is only available to the accounts invited to the alpha programme, and its features, interface and API may change.

## Objective

Each write to an Iceberg table adds a snapshot, metadata files and often small data files. Table maintenance runs the operations that clean them up, on the tables whose policy enables them.

**This guide explains how to enable table maintenance, check where it stands on a table and read the history of its runs.**

## Requirements

- A Lakehouse with at least one catalog and one schema. See [Lakehouse - Getting started](https://docs.ovhcloud.com/pl/guides/public-cloud/data-analytics/lakehouse/lakehouse-getting-started.md).
- To change a maintenance policy, a credential of a user with the **Lakehouse Admin** role. Every user who has access to an object can read its policy. See [Lakehouse - Managing access to your data](https://docs.ovhcloud.com/pl/guides/public-cloud/data-analytics/lakehouse/lakehouse-manage-access.md).

## Instructions

### Maintenance operations

Five operations are available:

| Operation               | What it does                                                                                                       |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------ |
| **Snapshot expiry**     | Removes the snapshots older than the snapshot retention, while keeping the number of snapshots set to always keep. |
| **Snapshot cap**        | Brings a table back to the maximum snapshot count, removing only the oldest snapshots of the main branch.          |
| **Orphan file cleanup** | Deletes the files of the table that no snapshot references. It only removes files older than 7 days.               |
| **Manifest rewrite**    | Rewrites the manifest files of the table.                                                                          |
| **File compaction**     | Compacts the small data files of the table (the `optimize` operation).                                             |

Each operation is off by default. **The runs of an operation you enable are billed.**

### Maintenance policy

A maintenance policy says which operations run and with which settings. You can set one on the Lakehouse, on a catalog, on a schema or on a table.

For each value, the level nearest to the table that sets it wins. A table inherits what its schema, its catalog and the Lakehouse set, except for the values it sets itself. A value cleared at a level is inherited again from the level above.

The policy is managed in the data console:

- the **Maintenance** tab of a table, a schema or a catalog;
- the **Maintenance** page of the Lakehouse, in the navigation of the data console.

### Step 1 - Enabling snapshot expiry on a schema

1. Sign in to the data console with the credential of a **Lakehouse Admin** user.

2. Open the schema, then its **Maintenance** tab. The **Schema maintenance policy** panel lists each setting, the value set at this level, the effective value and its limits.

3. Set **Snapshot expiry** to **On**.

4. Set the **Snapshot retention** and the number of **Snapshots always kept**, or leave them empty to inherit the values of the catalog or the Lakehouse.

   **Warning:** Snapshot expiry removes every snapshot older than the retention that no branch or tag keeps, including a snapshot that was staged and not yet published (write-audit-publish). A retention shorter than the time a staged snapshot waits for its publication loses it, and a retention of 0 expires it at the next run.

5. Click **Save**. The **Enable billed operations?** dialog lists the operations whose runs are billed. Click **Enable and save**.

Every table of the schema now inherits snapshot expiry, unless the table sets its own value. Within about 10 minutes, the platform writes the retention and the number of snapshots kept into the properties of these tables, when a level sets them. A value left to its default is not written.

To go back to the value of the level above, clear the field or choose **Inherit**, then save.

### Step 2 - Checking the maintenance of a table

Open a table, then its **Maintenance** tab. The **Operation status** section shows, for each operation:

- **Enabled**: whether the operation is enabled, and the level its value comes from (**Lakehouse**, **Catalog**, **Schema**, **Table** or **Default**);
- **Threshold**: the work waiting on the table, as a share of the threshold that triggers a run. The operation is due at 100%. The figure is shown for a disabled operation too, so you can see whether enabling it is worth it. Hover over the information icon to see how the operation is scored and when the table was last scored;
- **Next run**: **Due**, the date from which the operation becomes due when that depends on time alone, or **When the threshold is reached**. A due operation runs when its turn comes in the queue of the Lakehouse, usually within a few minutes;
- **Last outcome**: the result of the last run;
- **Current run**: a queued run, with its position in the queue of the Lakehouse, or a run in progress;
- **Suspension**: after three failed runs in a row, the operation is suspended on this table for 6 hours. Failures caused by the platform do not count.

A **health warning** badge appears next to the section title when the table holds more than 10,000 snapshots or takes more than 1,000 commits a day. Hover over it to read the warnings.

The figures reflect writes to the table within about 20 minutes. On a table of 100 snapshots or more, the snapshot expiry figure is updated when the operation can become due, or at the date shown.

### Step 3 - Reading the run history

The **Last runs** section of the **Maintenance** tab of a table lists its last 100 runs. A **Lakehouse Admin** also finds the last 100 runs of the whole Lakehouse on the **Maintenance** page of the Lakehouse. Runs are kept for 90 days after they end.

Each run shows:

- the **Operation** and the **Trigger**, which says why it ran;
- its **Status** and its outcome;
- its times: **Queued**, **Started** and **Ended**;
- what it measured: **Bytes freed**, **Bytes rewritten**, **Files deleted** and **Snapshots expired**. A figure the run could not measure is shown as absent.

A run whose trigger is **Forced by OVHcloud, not billed** was started by OVHcloud support and is not billed.

### Policy settings

| Setting                      | Default           | Limits                                    |
| ---------------------------- | ----------------- | ----------------------------------------- |
| **Snapshot retention**       | 7 days            | 0 to 90 days                              |
| **Snapshots always kept**    | 1                 | 1 to 100                                  |
| **Metadata versions kept**   | 100               | 1 to 1,000                                |
| **Maximum snapshot count**   | None              | 100 to 100,000                            |
| **Runs on** (Lakehouse only) | **Shared engine** | **Shared engine** or **Dedicated engine** |

Each operation is also enabled or disabled per level.

- **Snapshot cap** cannot be enabled unless a **Maximum snapshot count** is set at the same level or above.
- **Runs on** is set only in the policy of the Lakehouse. It chooses which Compute Pool runs the operations that need an engine: the shared Compute Pool, or a dedicated Compute Pool of the Lakehouse while that pool is running.

When a level sets them, the platform writes three settings to the table properties within about 10 minutes of a change, except on a table whose policy disables every operation:

| Setting                    | Table property                         |
| -------------------------- | -------------------------------------- |
| **Snapshot retention**     | `history.expire.max-snapshot-age-ms`   |
| **Snapshots always kept**  | `history.expire.min-snapshots-to-keep` |
| **Metadata versions kept** | `write.metadata.previous-versions-max` |

Clearing a setting leaves the last written value on the tables.

## Go further

[Lakehouse - Key concepts](https://docs.ovhcloud.com/pl/guides/public-cloud/data-analytics/lakehouse/lakehouse-concepts.md)

[Lakehouse - Using a dedicated Compute Pool](https://docs.ovhcloud.com/pl/guides/public-cloud/data-analytics/lakehouse/lakehouse-compute-pools.md)

[Lakehouse - Quotas and limits](https://docs.ovhcloud.com/pl/guides/public-cloud/data-analytics/lakehouse/lakehouse-quotas.md)

Join our [community of users](https://community.ovhcloud.com/).
