You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe
Normally, there is no identical index item in merge set. So mergeset/merge.go don't consider this scenorio in (bsm *blockStreamMerger) Merge.
But it still make sense for some offline data processing. for example, merging serveral backups into one.
Removing identical items help to shrink the size of index.
Describe the solution you'd like
if current item equals next item ,just skip it.
the code might look like this:
for bsr.currItemIdx < len(items) {
item := items[bsr.currItemIdx].Bytes(data)
itemStr := string(item)
if compareEveryItem && itemStr > nextItem {
break
}
// if equal to nextItem, skip this item
if itemStr != nextItem {
if !bsm.ib.Add(item) {
// The bsm.ib is full. Flush it to bsw and continue.
bsm.flushIB(bsw, ph, itemsMerged)
continue
}
}
bsr.currItemIdx++
}
this change requires a string == calculation, and performance call be improved by optimize string(item).
Describe alternatives you've considered
No response
Additional information
No response
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe
Normally, there is no identical index item in merge set. So mergeset/merge.go don't consider this scenorio in (bsm *blockStreamMerger) Merge.
But it still make sense for some offline data processing. for example, merging serveral backups into one.
Removing identical items help to shrink the size of index.
Describe the solution you'd like
if current item equals next item ,just skip it.
the code might look like this:
this change requires a string == calculation, and performance call be improved by optimize string(item).
Describe alternatives you've considered
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: