zeroshade commented on code in PR #2705:
URL: https://github.com/apache/iceberg-go/pull/2705#discussion_r4722026791


##########
table/equality_delete_reader.go:
##########
@@ -1141,31 +1145,48 @@ func equalityDeleteSetCombinationKey(files 
[]*equalityDeleteFileSet) string {
        return string(combinationKey)
 }
 
+// mergeEqualityDeleteSets combines the files' sets without copying their keys.
+// The largest file goes first, since most deleted rows are found there.
 func mergeEqualityDeleteSets(files []*equalityDeleteFileSet) 
*equalityDeleteSet {

Review Comment:
   This is where the tradeoff comes from: once the group holds references 
instead of a merged copy, each row is probed once per file. See the summary for 
a key → max-sequence-number structure that keeps one probe per row without 
per-group copies.



##########
table/equality_delete_reader.go:
##########
@@ -2095,6 +2116,7 @@ func (m *equalityDeleteMask) applySingleInt32(
 // switches. Each delete set is applied independently because sets may have
 // different field IDs.
 func processEqualityDeletesColumnarForFile(ctx context.Context, eqDeleteSets 
[]*equalityDeleteSet, fileSchema *iceberg.Schema, dataFilePath string) 
(recProcessFn, error) {
+       eqDeleteSets = expandEqualityDeleteSets(eqDeleteSets)

Review Comment:
   After this expansion, the generic (multi-column / non-fast) path further 
down builds encoders with `makeArrowFieldEncodersWithTypes` and re-encodes 
`keyBuf` for every row once per delete file. All files in a group share 
`fieldIDs`, so the work is identical each time. The benchmark only covers the 
int64 fast path, so this regresses more than the table shows. If the per-file 
design stays, encode once per row per group and probe each file's map with the 
same buffer. Numbers for a multi-column key would help too.
   
   minor: per-batch setup (field resolution, typed index lookups, `dictMemos`) 
now also scales with the number of files rather than the number of groups.



-- 
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]

Reply via email to