Skip to content

Iceberg: skip manifests by partition summary, and read partition values by field id #2318

Open

Description

@aaj3f

Problem

The first scan of an Iceberg snapshot reads every manifest the snapshot lists, whatever its filter. The partition summaries in the manifest list could rule out most manifests for a filter on a partition source column, but nothing reads them:

  • fluree-db-iceberg/src/scan/pruning.rs: can_contain_partition returns true for every column predicate and has no callers.
  • fluree-db-iceberg/src/manifest/data_file.rs, parse_partition_data: each partition value is keyed by name.parse::<i32>().unwrap_or(0). Partition field names are not numbers (region, ts_day), so every value lands on key 0 and overwrites the one before. Values that aren't Avro Bytes are dropped (partition values are typed: string, int, date, ...). DataFile.partition is therefore unusable for pruning.

Since #2315 (for #2240), a snapshot's file list is read once (up to 16 manifests at a time), kept in memory and in the disk catalog cache, and every later scan of the snapshot prunes the kept list in memory. So this cost is paid once per snapshot: on its first scan in a process with a cold disk catalog cache. On a table with many manifests behind an object store, that first scan is still dominated by manifest reads, and a table that commits often pays it for every new snapshot.

Expected

  • A manifest whose partition summaries exclude the filter is not read (identity transform first; then day/month/year/hour and bucket[N], truncate[W]).
  • DataFile.partition holds typed values keyed by partition field id, so file-level pruning can use them where the column bounds are missing or wide.

Notes

  • Needs the partition spec (partition-specs in table metadata, by partition_spec_id on each manifest-list entry) to map each partition field to its source field id and transform, and the manifest's Avro schema for the typed values.
  • Changing PartitionData changes the serialized DataFile in the persistent scan-files disk cache, so CACHE_FORMAT_VERSION in fluree-db-api/src/graph_source/disk_catalog_cache.rs needs a bump.
  • The scan-files cache keeps a snapshot's whole unfiltered list, and every scan plans from it (SendScanPlanner::plan_from_files). A manifest skipped by a filter's partition summary would leave that list incomplete. So summary skipping can only apply to a plan that does not populate the cache, or the cache must record that its list is partial and for which filter. One option: skip by summary only when the in-memory budget would refuse the list anyway (FLUREE_ICEBERG_SCAN_FILES_CACHE_MB).
  • A parsed-manifest cache keyed by manifest path (manifests are immutable and shared across snapshots) would let a new snapshot of an append-only table read only the manifests it added. That is the larger win for a table that commits often.

Related: #2240, #1910.

Follow-up from #2315.

Activity

  1. added
    P3
    area:iceberg
    performance
    on Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3area:icebergperformance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions