liveBook · Manning

Partition pruning

As explained in Architecting an Apache Iceberg Lakehouse

Partition pruning is the elimination of data partitions that cannot satisfy a query's filters before or during data access.

Partition pruning eliminates partitions or files that cannot satisfy a query filter before they are scanned. It reduces object-store listings, file reads, latency, and compute consumption. The architectural value depends on moving filtering into query planning rather than discovering irrelevant data late during execution. section 1.5 section 2.6.5

A metadata-driven pruning path typically works as follows:

  • Use table and manifest-list statistics to exclude partitions that cannot match the filter. section 2.3
  • Use manifest-file metadata and file-level statistics to exclude individual Parquet files before scanning their contents. section 2.3 section 3.4.3
  • Use Parquet row-group statistics and predicate pushdown to skip nonmatching row groups within selected files. section 5.3.1

Partition pruning is most effective when storage serves files consistently and predictably. Compression, file-size tuning, caching, and parallel execution complement pruning, while variable storage performance can reduce its benefits. Teams should benchmark representative sequential reads, tail latency, and concurrency rather than relying only on advertised throughput. section 5.1.1 section 5.3.1

Filtering a sales table in Dremio

When a query searches for records whose sales_amount is 35, Dremio can skip a file whose metadata reports a sales_amount range of 38 to 40. Dremio’s native Iceberg integration also supports partition pruning and other Iceberg-aware performance enhancements, allowing teams to query lakehouse tables without duplicating data into a warehouse. section 3.4.3 section 8.5.2

Figure 2.4 Engines use metadata statistics to exclude data files from scans, speeding up queries.

Use the metadata-flow diagram to trace how statistics exclude irrelevant data files before scanning. section 2.3

How Architecting an Apache Iceberg Lakehouse covers it

How deep it goes
Explains planning, manifest, file, and row-group filtering, then stops short of detailed partition-design procedures.
Examples
Uses January 2024 filtering, a sales_amount range test, Dremio queries, manifest statistics, and Parquet row-group metadata.
What it assumes
Assumes familiarity with query filters, files, partitions, Parquet, and Iceberg metadata while explaining pruning from first principles.
What you can do after
Apply it via Dremio and Apache Iceberg to reduce scanned data, query latency, object-store operations, and compute cost.
How it connects
Connects partition pruning with Apache Iceberg, metadata management, Parquet, predicate pushdown, query planning, and object storage.

Also explained in

Compare how 3 books explain partition pruning →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Architecting an Apache Iceberg Lakehouse. The section links point to the parts of the book it draws on.