Optimizing a Fabric data warehouse

By Hatnest · Reviewed by Saurav Raj Joshi · Updated Nov 30, 2026

A Fabric warehouse stores its tables as Delta and Parquet files in OneLake, runs queries on a massively parallel engine, and looks after much of its own housekeeping: compaction, checkpointing and caching are automatic. Your tuning is therefore different from a classic SQL Server. You influence the data layout, the way data is loaded, the schema and the statistics.

Load data the way the engine likes

  • Avoid trickle writes. Each small INSERT, UPDATE or DELETE creates new Parquet files, leaving many small files and fragmented row groups. The engine compacts them in the background, but queries can be slower until it catches up. Batch your changes: stage the data and insert it with one statement, and apply updates and deletes in batches.
  • Use COPY INTO to load from Azure Data Lake Storage. It is the recommended route. For best throughput, use files of roughly 100 MB to 1 GB each, and as many of them as you can while keeping them above 100 MB. Several COPY INTO statements can load different tables in parallel. BULK INSERT is a synonym.
  • Use CTAS or INSERT ... SELECT from a lakehouse table or shortcut. These are often faster and more reliable than moving the same data through a pipeline.
  • When you query files directly with OPENROWSET, prefer Parquet over CSV, keep files similar in size and use folders for partitions.
  • For heavier loads, a larger capacity gives more parallel compute.

Statistics

The optimizer relies on statistics to choose a plan. The warehouse creates and maintains them automatically at query time, and you can add your own single-column histogram statistics for columns used in filters, joins, GROUP BY and ORDER BY. Refresh them after loads that change row counts or distribution, particularly if there is a gap between loading and querying.

CREATE STATISTICS DimCustomer_CustomerKey_FullScan
ON dbo.DimCustomer (CustomerKey) WITH FULLSCAN;

UPDATE STATISTICS dbo.DimCustomer (DimCustomer_CustomerKey_FullScan) WITH FULLSCAN;

Design the schema for speed

  • Use proper types: date or datetime2(n) for time values, integer types for whole numbers, and the smallest decimal precision and scale that fits.
  • Use the shortest varchar(n) that fits. Oversized strings and large objects hurt. A Spark string column with no length is seen by the warehouse as varchar(8000), so define lengths when you create lakehouse tables in Spark SQL.
  • Declare columns NOT NULL where the data allows.
  • Match data types for columns that are compared in joins or filters, so no implicit conversion is needed.
  • Primary and unique key constraints are not enforced, so do not assume they make good join columns.

Data clustering

Data clustering (preview) stores rows with similar values near each other as they are ingested, so queries that filter on those columns can skip whole files. You declare it when you create the table, with up to four columns. It is not supported for tables created with SELECT INTO. Large tables with repeated selective filters on the same columns gain most.

CREATE TABLE dbo.Sales (SaleDate date, StoreId int, Amount decimal(19,4))
WITH (CLUSTER BY (SaleDate, StoreId));

V-order and caching

  • V-order is on by default in a warehouse and suits read-heavy and mixed workloads. Disabling it helps only strictly write-intensive warehouses, and it cannot be re-enabled afterward. A common pattern is a staging warehouse with V-order off for fast ingestion, feeding a V-order warehouse for reporting.
  • Cold start. The first run of a query may be slower because data is read from OneLake and statistics created. The column data_scanned_remote_storage_mb in queryinsights.exec_requests_history is non-zero for a cold run. Do not judge performance from the first run.
  • Result set caching stores final results of eligible SELECT queries so repeats skip the work, and the cache is invalidated when the data changes. It applies to warehouses and lakehouse SQL analytics endpoints.

Write better queries

  • Return only needed columns and rows: avoid SELECT * and filter in the warehouse, early, before joins.
  • A "non-scalable operation" warning means part of the plan runs on a single node. Reduce the filtered data size, or, if the query does not require single-node execution, try OPTION (FORCE DISTRIBUTED PLAN).
  • Query hints are for advanced use, after the basics.

Other useful features

  • Clone tables instead of copying them. A clone duplicates metadata only, and keeps security such as row-level security and masking.
  • Watch the workload with the queryinsights views (execution history for 30 days, long-running and frequently run queries) and DMVs. See the query optimization article for how to read them.
  • Lakehouse tables read through the SQL analytics endpoint are not maintained by the warehouse, so run lakehouse maintenance for them.

For the exam

  • Batch writes and use COPY INTO with files of 100 MB to 1 GB; avoid trickle inserts.
  • Keep statistics current; create them for columns used in joins and filters.
  • CLUSTER BY at table creation (up to four columns) enables file skipping.
  • V-order is on by default and disabling it is irreversible.
  • A slow first run may be a cold start; check data_scanned_remote_storage_mb.

Sources