-
Notifications
You must be signed in to change notification settings - Fork 597
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(streaming): remove get_compacted_row
from StateTable
#20034
Conversation
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Could you elaborate on this?
Is this in all cases? Or just for materialize? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGMT
I thought this optimization should exist for streaming executors, such as HashJoin. But it turns out to be not? |
For tables, we use column-aware encoding in the storage to support schema change. To get a For materialized views, we enforce the invariant of a retractable stream internally, so there's no need for conflict handling. As a result,
In streaming cache, there's a need for a more compact row representation than Let's check the properties of Pros:
Cons:
If we are going to introduce a new in-memory compacted representation, it's easy to see that we can likely eliminate all cons, and retain all pros except for However, as this PR has shown that this optimization is never actually utilized, we are free to explore the alternatives with less concern. |
I guess it's because |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…0034) Signed-off-by: Bugen Zhao <i@bugenzhao.com>
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
The point of
StateTable::get_compacted_row
is that, when a table is using value-encoding, we can save a roundtrip of parsing the encoded row bytes into anOwnedRow
and serializing it back.This function is currently used only by
MaterializeCache
when a state table has an on-conflict behavior set. However, in such cases, the state table must be a userTABLE
that adopts column-aware encoding. As a result, the optimized branch is effectively dead.In this PR, we remove this function and inline it to its only caller.
This shows us that there's no significant benefit to stick with value-encoding for its memory-efficiency , and we may adopt a better encoding for this (see #20017 for more details).
Checklist
Documentation
Release note