Why Row-Group Sizing Breaks Parquet Predicate Pushdown

Columnar file formats promise fast zone-map skipping. Yet if ingestion writers flush large unsorted row groups, a single outlier tenant ID drags every min/max footer interval across the full keyspace.

Apache Parquet stores metadata min/max bounds per column chunk inside each row group, along with finer-grained column indexes at the data-page boundary in newer writers. Query engines like DuckDB, Trino, and DataFusion inspect those footer statistics before issuing object-store byte-range GETs.

In theory, filtering WHERE account_id = 48120 skips almost every row group. In practice, un-sorted streaming writers mix rows from ten thousand accounts into every 128 MB row group, guaranteeing that min(account_id) <= 48120 <= max(account_id) evaluates true everywhere.

Predicate: account_id = 48120 Unsorted RG: [1 .. 99999] [4 .. 99991] [2 .. 99988] [9 .. 99995] Sorted RG: [1 .. 25000] READ [25k..50k] [50k .. 75k] [75k .. 99k]
Figure 1: Sorting before flush narrows min/max intervals so non-matching row groups never issue object-store range GETs.

Why giant row groups hurt twice

Many legacy Hadoop recommendations push engineers toward 256 MB or 512 MB row groups for HDFS block alignment. On cloud object stores (S3, GCS, R2), HTTP range reads parallelize efficiently down to 16–32 MB column footprints, while oversized row groups crush pruning selectivity unless the entire batch was pre-sorted by the filter key.

Measuring row-group pruning selectivity directly using DuckDB parquet_metadata:
check_rowgroup_overlap.sql
SELECT
  row_group_id,
  row_group_num_rows,
  stats_min_value,
  stats_max_value
FROM parquet_metadata('events/part-*.parquet')
WHERE path_in_schema = 'account_id'
ORDER BY row_group_id
LIMIT 20;

Practical defaults for selective workloads

  • Sort buffered batches by (primary_filter_key, timestamp) immediately prior to Parquet serialization.
  • Target 65,536 to 262,144 rows per row group (roughly 16–64 MB compressed) rather than multi-hundred-megabyte blocks.
  • Enable Parquet bloom filters specifically on high-cardinality point-lookup columns (such as trace_id or session_uuid) that cannot share the primary sort order.