DLF storage optimization simplifies Paimon table maintenance through adaptive compaction, expired snapshot cleanup, partition lifecycle management, and orphan file cleanup. This guide covers the available optimization strategies and how DLF executes them.
Iceberg tables lack automatic storage reclamation. To prevent storage cost spikes, periodically clean up expired snapshots and orphan files as described in Iceberg table storage governance.
Storage optimization strategies
Strategy type | Description | DLF execution mechanism |
Merges small files into larger ones, reducing file count, metadata overhead, and file lookup costs during queries. Improves Paimon table query performance. | DLF automatically triggers compaction when data writes are committed. | |
Snapshots protect referenced data files from deletion, preserving historical states. As snapshots accumulate, storage consumption grows. Expiring unneeded snapshots frees storage space. | DLF triggers expired snapshot cleanup automatically during storage optimization jobs. The default expiration time is one hour, adjustable through Paimon table parameters. For more information, see Clean up expired data. | |
Many scenarios require only recent data. Partition data by time and set expiration rules to automatically delete old partitions, freeing storage. Configure intelligent storage tiering to move infrequently accessed data from Standard to lower-cost storage classes (Infrequent Access, Archive, or Cold Archive). | Configure expiration time through Paimon table parameters in Set partition expiration time. After configuration, cleanup triggers automatically during DLF storage optimization jobs. Use intelligent storage tiering to move eligible partition data to lower-cost storage classes, or manually change the storage class on the Table Details page. The Storage Overview page shows tiering distribution across catalogs, databases, and tables. | |
Orphan files are files that exist under the table storage path but are not referenced by any snapshot. They typically result from interrupted write jobs, failed commits, or residue left by abnormal cleanup processes. Because no snapshot references them, snapshot expiration cannot remove them, so they require periodic cleanup. | You can trigger orphan file cleanup manually from the console or enable automatic cleanup. Cleaned orphan files are moved to the recycle bin ( |
Enable or disable intelligent storage optimization
The Storage Optimization tab appears only for Paimon tables.
Log on to the DLF console
On the Catalogs page, click the catalog name.
On the Database tab, click the name of the target database to view its tables.
In the Tables list, click the name of the target table to view its schema information.
Click the Storage Optimization tab. The intelligent storage optimization switch is enabled by default. To disable it, click the
switch.
View and configure storage optimization strategies
Compaction
On the Storage Optimization tab, click Compaction to view the execution status, rescale records, and execution history.
Edit the policy mode based on your requirements:
Dynamic resource mode (recommended)
The system automatically scales compute resources based on real-time workload, eliminating manual capacity planning. Suitable for fluctuating traffic.
Three configuration preferences are available:
Balanced: Balances compaction speed and resource consumption (default).
Low latency: Allocates more resources for faster compaction, reducing data visibility delay.
Low resource usage: Limits resource usage to reduce compute costs at the expense of longer compaction time.
Dynamic resource allocation and scaling
Fixed resource mode
Manually specify compute resources for compaction. Suitable for stable traffic or strict cost control.
Configuration requirements: Minimum 2 CU.
Parameter settings: Customize the compaction trigger interval and bucket count.
View execution status
View the optimization execution status for the current table and configure CloudMonitor alert subscriptions through Monitor lakehouse optimization.
View rescale records
Logs bucket rescaling events for a table or specific partitions, reflecting changes in the physical storage structure. Rescaling addresses performance issues from data volume changes. Use these records to check if a table is undergoing a rescale, which prevents compaction.
View execution history
View the compaction execution history for the current table. Use these records to:
Confirm task execution: Verify that background compaction tasks run correctly and prevent small file accumulation.
Evaluate compaction efficiency: Compare file count and size before and after compaction to assess strategy effectiveness.
Expired snapshot cleanup
On the Storage Optimization tab, click Expired Snapshot Cleanup to configure cleanup rules and view results.
Configure snapshot cleanup rules
Click Modify, set the Snapshot Retention Period (default is 1 hour), and click Save.
View snapshot cleanup results
Current snapshot count: The number of remaining snapshots.
Earliest snapshot information: Details of the earliest snapshot, including snapshot ID, commit time, commit type, total row count, and rows added in the commit.
Partition lifecycle management
On the Storage Optimization tab, click Partition Lifecycle to configure cleanup rules, view results, and set up storage tiering.
Partition cleanup rules
Click the
switch next to Expired Partition Cleanup to enable it.Configure the following cleanup rules, then click Save.
You can also configure these settings through table option key-value pairs.
Parameter
Description
Expiration Policy
(partition.expiration-strategy)
You can select one of the following expiration strategies:
Based on last access time (access-time): Expires partitions based on their last access time.
Based on partition value (values-time): You can configure the partition timestamp format and pattern.
Timestamp format (partition.timestamp-formatter): You can configure formats such as
yyyy-MM-dd,yyyyMdd,dd/MM/yyyy, anddd.MM.yyyy.Timestamp pattern (partition.timestamp-pattern): By default, the first partition field is used. You can configure patterns such as
$dtor$year-$month-$day.
Based on last update time (update-time): Expires partitions based on their last update time.
Partition Retention Period
(partition.expiration-time)
Unit: days. Example:
30d. The maximum value is 999,999 days. The retention period starts based on the selected expiration strategy.(Optional) After saving, click Cleanup Rule Settings next to Modify to modify settings.
To retain partitions permanently, do not configure expiration rules. The system does not clean up partition data by default.
Partition cleanup results
Click View Partitions to view the partition list, including partition name, row count, referenced files, file size, creator, storage class, last modified by, timestamps, and actions.
Storage tiering
Parameter | Description |
Intelligent Tiering |
Note
|
Tiering Strategy |
|
Tiering Rule | Minimum storage duration requirements vary by storage class. Configure tiering rules:
|
Beyond intelligent storage tiering, you can manually change the storage class on the table details page. The Storage Overview page shows tiering distribution across catalogs, databases, and tables.
Orphan file cleanup
On the Storage Optimization tab, click Orphan file cleanup to trigger orphan file cleanup manually.
To enable automatic cleanup, add auto-orphan-files-clean.enabled = true to the catalog configuration. Cleaned orphan files are moved to the recycle bin (system.trash) temporarily. Adjust how long files stay in the recycle bin with the dlf.trashed-file-retained-days catalog configuration.
Manually change the storage class
In the Database list, click a database name to view the table list.
In the Tables list, click a table name to view its schema.
Click the Table Details tab to manually change the storage class for partitioned and non-partitioned tables.
Partitioned tables
On the Partitions tab, you can change the storage class for partitions.
For partitions in the Standard, Infrequent Access, or Archive storage class:
In the Actions column, click Modify Storage Class to change to any other storage class.
For partitions in the Cold Archive storage class:
Restore the data first, then change the storage class:
Click Restore and configure the Restored Copy Availability Duration. You can select multiple partitions for a batch restore.
Value range: An integer from 1 to 365 (unit: days).
Default value: 1 day.
When the data enters the restored state, click Modify Storage Class in the Actions column to change the storage class.
Non-partitioned tables
In the Basic Information section of the table, you can modify the Storage Class.
For Standard, Infrequent Access, or Archive storage classes:
Click Edit next to Storage Class to change to any other storage class.
For the Cold Archive storage class:
Restore the data first, then change the storage class:
Click Restore next to Storage Class and configure the Restored Copy Availability Duration.
Value range: An integer from 1 to 365 (unit: days).
Default value: 1 day.
When the Storage Class changes to Cold Archive (Restored), click Edit next to Storage Class. You can then change it to any other storage class.
NoteRestore time: Cold Archive supports only standard restore priority, which takes 2 to 5 hours.
Restored state start time: When the first Cold Archive object in a partition enters the restored state after the restore completes.
Restored copy availability duration: How long data remains accessible after restoration from Cold Archive. After expiration, the partition returns to the frozen state. Submit a new restore request to access it again.
Restore procedure
The object starts in the frozen state.
After submitting a restore request, the object enters the restoring state. Restore time varies.
After restoration completes, the object enters the restored state. For table-level storage tiering, the partition becomes accessible after all objects are restored.
Extend the restored state by adjusting the restored copy availability duration, up to the maximum allowed for the storage class.
After the restored copy availability duration expires, the object returns to the frozen state. Submit a new restore request to access it again.
When enabled, the system automatically tiers storage for all tables in the catalog based on configured lifecycle rules. Specify the strategy and rules as needed.