Optimizing query performance
Queries on Apache Iceberg tables slow down when a table has many small files, unevenly sized partitions, or a large amount of metadata to plan over. The following advanced tier metrics help you find these conditions and the tables they affect.
- Small file accumulation
-
Use the live small data file percentage, the data file size distribution, and the average live data file size. A high small file percentage, or a distribution weighted toward the smallest size ranges, means that compaction isn't keeping files near the target size. Confirm that compaction is enabled and that the compaction target file size suits the workload.
- Partition skew
-
Partition skew is the size of the largest partition divided by the average partition size. A high value means that a few partitions hold most of the data, so queries that scan those partitions do more work. On the Partitions tab, the partition small file percentage shows whether individual large partitions are also fragmented.
- Metadata bloat
-
Use the metadata and manifest file counts and storage bytes, and the total snapshot count. A growing number of manifest files or retained snapshots increases the metadata that query engines read during planning. Snapshot management settings control how many snapshots the table retains.
- Delete file accumulation
-
Use the delete file count and delete file storage bytes. Accumulated position and equality delete files add merge work at read time. Compaction removes them by rewriting the affected data files.
The dashboard also shows recommendations next to the relevant metrics. For example, when a table's average data file size is below the compaction target, Amazon S3 Storage Lens for Tables recommends confirming that compaction is enabled and that the target file size is set appropriately for the workload.