# Apache Iceberg Clustering and Sort Order Evolution: When to Rewrite Data

DevFeed: [Apache Iceberg Clustering and Sort Order Evolution: When to Rewrite Data](<https://devfeed.tech/articles/apache-iceberg-clustering-and-sort-order-evolution-when-to-rewrite-data-102840.md>)

Original publisher: [Read original article](<https://www.dremio.com/blog/apache-iceberg-clustering-and-sort-order-evolution-when-to-rewrite-data/>)

Author: Alex Merced

Published: 2026-10-27T18:56:57Z

Content type: article

Language: en

Sources: [Dremio](<https://devfeed.tech/sources/dremio.md>)

Topics: [Apache Iceberg](<https://devfeed.tech/topics/apache-iceberg.md>), [Sorting](<https://devfeed.tech/topics/sorting.md>), [Apache Spark](<https://devfeed.tech/topics/spark.md>), [parquet](<https://devfeed.tech/topics/parquet.md>), [Grafana](<https://devfeed.tech/topics/grafana.md>), [Amazon S3 Tables](<https://devfeed.tech/topics/amazon-s3-tables.md>)

Tags: [apache-iceberg](<https://devfeed.tech/tags/apache-iceberg.md>), [data-lakehouse](<https://devfeed.tech/tags/data-lakehouse.md>), [dremio-blog-open-data-insights](<https://devfeed.tech/tags/dremio-blog-open-data-insights.md>), [evolution](<https://devfeed.tech/tags/evolution.md>), [rewrite](<https://devfeed.tech/tags/rewrite.md>), [sort](<https://devfeed.tech/tags/sort.md>)

## AI overview

Changing an Apache Iceberg sort order updates table metadata for future writes; it does not reorder existing files or refresh their file statistics. Rewriting old files is worthwhile only when measured pruning and query savings justify the I/O, commit load, and operational risk. The text recommends identifying frequent, high-value predicates, recording baseline files read, bytes scanned, and query latency, then testing the new sort order and a bounded rewrite on representative files. Compare pruning and end-to-end performance after each batch, while monitoring commit latency, retries, storage activity, and coordinator load. If gains persist, expand in controlled waves; stop if payback is weak or operational costs exceed the measured benefit. Exact DDL and rewrite procedures depend on the Iceberg, engine, and catalog versions, so verify supported syntax and APIs in the deployed environment. The suggested batch sizes and cluster observations are examples, not universal guarantees.

## Source excerpt

Evolve Iceberg sort orders safely, measure pruning quality, choose sort or Z-order rewrites, and decide when existing data justifies a controlled rewrite. The post Apache Iceberg Clustering and Sort Order Evolution: When to Rewrite Data appeared first on Dremio.