Repository navigation
Open
Labels
P3Backlog: valid, low payoff-per-effortarea:icebergIceberg catalogs/credentials, R2RML, virtual datasets, materializeperformancePerformance improvement (release notes: Performance)
Description
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_partitionreturnstruefor every column predicate and has no callers.fluree-db-iceberg/src/manifest/data_file.rs,parse_partition_data: each partition value is keyed byname.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 AvroBytesare dropped (partition values are typed:string,int,date, ...).DataFile.partitionis 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/hourandbucket[N],truncate[W]). DataFile.partitionholds 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-specsin table metadata, bypartition_spec_idon 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
PartitionDatachanges the serializedDataFilein the persistent scan-files disk cache, soCACHE_FORMAT_VERSIONinfluree-db-api/src/graph_source/disk_catalog_cache.rsneeds 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.
Follow-up from #2315.
Metadata
Metadata
Assignees
Labels
P3Backlog: valid, low payoff-per-effortarea:icebergIceberg catalogs/credentials, R2RML, virtual datasets, materializeperformancePerformance improvement (release notes: Performance)
Activity