RDDT: Avoid materializing string views on group by - #29
Open
hicder-rddt wants to merge 1 commit into
Open
Conversation
hicder-rddt
force-pushed
the
hieu/string-group-by-view-optimization
branch
from
August 1, 2026 14:24
d76bbcd to
d65731b
Compare
hicder-rddt
force-pushed
the
hieu/string-group-by-view-optimization
branch
2 times, most recently
from
August 1, 2026 15:52
36d5d88 to
2a377e3
Compare
hicder-rddt
marked this pull request as ready for review
August 1, 2026 15:52
hicder-rddt
force-pushed
the
hieu/string-group-by-view-optimization
branch
from
August 1, 2026 15:52
2a377e3 to
c17c326
Compare
hicder-rddt
force-pushed
the
hieu/fix-cpp-tests
branch
4 times, most recently
from
August 1, 2026 15:54
948f770 to
f02f254
Compare
hicder-rddt
force-pushed
the
hieu/string-group-by-view-optimization
branch
from
August 1, 2026 15:54
c17c326 to
b0cbde7
Compare
hicder-rddt
force-pushed
the
hieu/fix-cpp-tests
branch
from
August 1, 2026 15:56
f02f254 to
3faf998
Compare
hicder-rddt
force-pushed
the
hieu/string-group-by-view-optimization
branch
from
August 1, 2026 15:56
b0cbde7 to
9f1ea7c
Compare
hicder-rddt
force-pushed
the
hieu/string-group-by-view-optimization
branch
from
August 4, 2026 12:32
9f1ea7c to
9ede262
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
3x reduction in both CPU and p99 latency for
feeds-posts-3One of the inefficiency I just found in Milvus: during group-by, let's say a segment has 1 million docs, and we need to get document 5, 10, 20. Currently, Milvus will:
a. On a high level, the way is does is:
for 0 to 1M, string_views.push_back({offsets[i], len[i]})(5, 10, 20), Milvus will readstring_views[5],string_views[10],string_views[20]respectively, and return the corresponding documents.From our flamegraph, step 1 takes 66% of the CPU! However, it's a waste! All we need to do is: read (
{offsets[5], len[5]},{offsets[10], len[10]},{offsets[20], len[20]}), then return the corresponding documents.Result: we managed to reduce CPU usage by 3x, and latency also reduced by 3x!
