AnirudhSriram opened a new issue, #2703: URL: https://github.com/apache/iceberg-go/issues/2703
### Apache Iceberg version main (development) ### Please describe the bug 🐞 Equality delete key sets use memory that grows with the square of the number of equality delete files. An equality delete applies only to data files with a lower sequence number. After N commits that each add an equality delete file (and no compaction), the data file from commit i sees delete files i+1..N, so a scan has up to N different groups of delete files. `mergeEqualityDeleteSets` (`table/equality_delete_reader.go`) builds one merged map per group and copies every key of the group into it. With k keys per file, the per-task sets hold about k × N²/2 keys. https://github.com/apache/iceberg-go/blob/4ea6ff7/table/equality_delete_reader.go#L1144-L1169 **Measurement.** 100 delete files with 10,000 keys each (1M keys), and 100 tasks where task i sees delete files i..99. `buildEqualityDeleteSetsPerTask` holds 50.5M keys across the per-task sets, and the heap grows by about 2 GiB. The typed single-column indexes (`singleInt64Set` and others) are then built per merged set too. **Possible fix.** A combined set keeps references to its files' sets instead of copying their keys, and the delete filter applies each file's set (and its typed index) in turn. Memory is then linear in the delete keys (about 30 KiB for the same case). The cost is one lookup per delete file in the group for each row, instead of one. I have a PR with this and numbers for both sides, and I'm open to a different approach. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
