A Fabric Lakehouse can begin with a simple ingestion notebook and still become difficult to operate as data volume and workload concurrency grow. Small files, wide tables, unnecessary history, unselective queries and poorly timed maintenance can increase latency and capacity pressure. Delta table optimisation is not a one-time cleanup task; it is an engineering practice aligned to how data is written and consumed.
Choose the Delta maintenance operation
Select an operation to understand what it changes—and what it does not.
OPTIMIZE rewrites eligible files to reduce small-file overhead and improve read efficiency. It consumes compute and should be scheduled based on evidence.
Primary effect: file compactionWhat should each layer prioritise?
Select a layer to explore its typical optimisation objective.
Keep ingestion robust and preserve the ability to replay source data. Avoid costly rewrites unless file accumulation is measurably affecting downstream consumers.
What should you measure before and after?
Choose the primary consumer to focus the benchmark.
Compare scan duration, files read, shuffle volume, write throughput and maintenance cost using the same input and cluster configuration.
1. Diagnose the workload before tuning
Start by identifying the consumer and the symptom. A table read by Spark batch jobs may need a different layout from a Gold table queried by Power BI Direct Lake or a SQL analytics endpoint. Capture query duration, files scanned, data volume, write frequency, concurrency and freshness requirements before changing table settings.
Separate ingestion performance from read performance. A write optimisation that improves downstream scans can add work to each micro-batch. A maintenance job that rewrites too much data can compete with business-critical pipelines. Tune against a measurable service objective, such as a report latency target or an ingestion completion window.
2. Understand why small files matter
Frequent small writes can create many small Parquet files. Each file adds metadata and planning overhead; readers may need to open and inspect many files to answer a query. This is particularly noticeable when tables receive frequent incremental loads or many tiny micro-batches.
Compaction combines smaller files into fewer, larger files. In Fabric, Delta table maintenance can run OPTIMIZE to compact files, and can optionally apply V-Order. The correct target file size depends on the workload, data distribution and engine. Avoid blindly compacting every table after every pipeline run.
3. Use OPTIMIZE with a clear purpose
OPTIMIZE rewrites eligible data files to improve layout. It is useful after batch loads or when small-file accumulation is affecting reads. For partitioned tables, selective optimisation and predicates can reduce the amount of data rewritten. For tables using Liquid Clustering, optimisation also manages the clustering layout.
Schedule maintenance based on write cadence and query behaviour. A high-volume daily batch table may benefit from a post-load maintenance window. A streaming table may need a different cadence, and the Fabric runtime version affects the cost model for repeated clustering optimisation. Review current runtime guidance before adopting a frequent schedule.
4. Understand V-Order and its trade-offs
V-Order is a write-time optimisation for Parquet files designed to improve read performance across Fabric engines through file-internal ordering, encoding and compression. It is not a substitute for good data modelling, selective filters or compaction.
V-Order can increase write time. Microsoft documentation describes a measurable write-time trade-off and potential compression benefits, but actual results depend on data shape and workload. Benchmark it on representative tables: compare write duration, file size, Spark read time, SQL query time and Direct Lake report behaviour before applying it broadly.
5. Use clustering for selective access patterns
When users repeatedly filter or join on a small set of columns, file layout can influence how much data must be scanned. Liquid Clustering organises data around chosen columns and can improve data skipping for supported workloads. It is designed to evolve as data is written, rather than requiring a fixed partition scheme for every use case.
Choose clustering columns based on observed query filters and cardinality, not simply because a column appears in a common dashboard. Too many or poorly selected columns can dilute the benefit. Monitor clustering quality and file-scan metrics, and validate that the relevant runtime and table features support the chosen approach.
6. Use VACUUM carefully
Delta tables retain old file versions so readers and time-travel operations can use the transaction history within the configured retention model. VACUUM removes unreferenced data files that are older than the retention threshold. This can reduce storage usage, but it is not a general-purpose delete command and should never be run without understanding retention and concurrent-reader requirements.
Keep retention aligned to recovery expectations, streaming readers, long-running queries and any downstream process that may still reference an older snapshot. Do not disable safety checks merely to reclaim storage quickly. Test the maintenance policy in a non-production workspace and document who can run it.
7. Build a maintenance strategy by medallion layer
Bronze tables prioritise reliable ingestion and replay. Avoid expensive rewrites without evidence that small files are harming downstream workloads. Silver tables often support repeated joins, deduplication and data quality checks; their maintenance can focus on predictable read patterns and frequently used keys. Gold tables serve analytics and may need the most deliberate layout, because report responsiveness is visible to business users.
These are starting points, not mandatory rules. A small Bronze table queried directly by analysts may need more read optimisation than a large but rarely scanned Silver table. Let workload evidence drive maintenance frequency and layout choices.
8. Example operational runbook
- Capture baseline query duration, files scanned, table size and write duration.
- Inspect table history and file distribution to confirm whether small files or layout are the issue.
- Choose a targeted OPTIMIZE strategy and evaluate V-Order or clustering only where supported and useful.
- Run representative Spark, SQL and Direct Lake tests after maintenance.
- Schedule VACUUM separately with a retention policy approved by data owners.
- Monitor maintenance duration, capacity impact, query improvement and storage changes.
- Revisit the policy when data volume, runtime version or consumer patterns change.
Frequently asked questions
Should OPTIMIZE run after every pipeline?
Not automatically. Frequent rewrites can consume compute and compete with ingestion. Use file counts, write patterns and query metrics to decide when maintenance is valuable.
Is V-Order the same as clustering?
No. V-Order changes how data is organised within Parquet files, while clustering organises values across files to support data skipping. They address different aspects of layout and may be complementary where supported.
Does VACUUM remove rows from the current table?
VACUUM removes unreferenced data files older than the retention threshold. It does not replace DELETE, UPDATE or MERGE operations on the current table. Its effect on historical versions and recovery windows must be understood.
Conclusion: optimise for the workload you actually run
Reliable Lakehouse performance comes from matching file layout and maintenance to ingestion cadence, consumer engines and service objectives. Measure first, make targeted changes, protect Delta retention, and verify the effect across Spark, SQL and Direct Lake rather than relying on a single benchmark.
Further reading
- Microsoft: Delta table maintenance in Fabric
- Microsoft: Liquid Clustering
- Microsoft: Medallion lakehouse architecture
- Microsoft: Delta Lake overview
- Modern lakehouse architecture
- TierShift Data Engineering
Building your Microsoft Fabric data platform?
TierShift helps teams design, engineer and optimise modern data platforms, governed analytics and reliable delivery workflows.
Talk to TierShift →