> 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/quickstarts-1/apache-iceberg/optimize-your-iceberg-tables.md).

# Optimize Your Iceberg Tables

## Create a connection to your catalog

Login to Upsolver and from the home screen select **Optimize My Iceberg Tables**. You can also click on the Upsolver logo at the top of the menu to view this screen:

<figure><img src="/files/CEUiUjj2uail2OCbMTLG" alt=""><figcaption><p>The Upsolver home screen provides the gateway to optimizing your Iceberg tables</p></figcaption></figure>

This displays the **Connect to Catalog** screen, enabling you to connect to AWS Glue Data Catalog or Tabular. If you already have a connection in Upsolver, select **Use an existing connection**, otherwise, select **Create a new connection**, and enter your credentials:

<figure><img src="/files/O4AV2PvFWyfDhK7HCJ6O" alt=""><figcaption><p>Connect to an existing or new catalog to AWS Glue Data Catalog or Tabular.</p></figcaption></figure>

When you have connected to your catalog, click **Select Tables** to continue to the next screen.

## Analyze your tables

This takes you to the **Datasets** screen. From the navigation tree, click one or more tables to add to the analyzer:

<figure><img src="/files/eGKqVLiEmQIsrIkB1UsY" alt=""><figcaption><p>Click on a table in the tree and Upsolver will analyze the files and partitions that comprise the table.</p></figcaption></figure>

The analyzer scans the partitions and files for each table you add, and calculates the potential space saving costs of running a compaction operation, and how much this will speed up scans. Each table you add to the list will be added to the optimization process. To remove a table from the list, click the **bin** icon at the far right of the row for the table you want to exclude.

You can view more detailed insights on a table by clicking the **information** icon at the far right of the row, or by clicking on the **Table Name** link. This displays a pop-up window with more statistics on the potential storage savings and data scan improvement:

<figure><img src="/files/jiKOGy8L9CV7mnMUkSNN" alt=""><figcaption><p>Look at the details for each table to determine if it requires optimizing.</p></figcaption></figure>

Click Remove **Table from Optimization**, or **Cancel** to close the window. Having selected your tables, click **Review Optimization** to navigate to the next screen when you can confirm your selection.

## Review your table selection

Review the SQL code for the tables you want to optimize. Optionally, you can click **Edit in Worksheet** if you want to make alterations to the code and execute it manually. Alternatively, you can click **Copy** to run the code from another query tool.&#x20;

When you are ready, click **Start Optimization**, and this returns you to the **Datasets** screen where you can monitor the space savings and data scan improvements following the optimization process.&#x20;

## Monitor table optimization

In Datasets, you can click on the table you selected for optimization to view the status of the optimization process, and see space savings. The **Table Statistics** tab displays running values for the count of files and partitions, the size of the table and potential savings:

<figure><img src="/files/eZ0BWvXvbrOjiKIrXTy0" alt=""><figcaption><p>The <strong>Table Statistics</strong> tab shows you the current size of your partitions and files and projected savings.</p></figcaption></figure>

Click on the **Compactions** tab to view the status for each partition: see the **Start Time** and **Status**, and the number of **Data Files** and the **Data File Size**, and scroll to the right to view information on equality and position delete:

<figure><img src="/files/oLTiwLg6onglNiz6KXiF" alt=""><figcaption><p>The <strong>Compactions</strong> tab displays in-depth statistics on each partition that comprises your table.</p></figcaption></figure>

{% hint style="success" %}
**Learn More**

See the [Table Statistics](broken://spaces/F7p4dCa9oywqOY5m31fr/pages/4TCqWoK17Zg8HVRQv4AT) and [Compactions](/content/reference-1/monitoring/datasets/maintenance/compactions.md) reference for more information about the details provided in these tabs.&#x20;

Learn the [Optimization Processes for Iceberg Tables in Upsolver](/content/articles-1/data/optimization-processes-for-iceberg-tables-in-upsolver.md) to understand the operations that Upsolver performs.
{% endhint %}


---

# 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/quickstarts-1/apache-iceberg/optimize-your-iceberg-tables.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.
