Skip to content
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

Consolidate output diffs before producing tuples #489

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

frankmcsherry
Copy link
Member

The Arranged::as_collection method converts an arrangement to a stream of its underlying updates. It does this without any thought for consolidation as it does, under the historically accurate but no longer correct take that the full arrangement detail is required. When one uses a TraceFrontier wrapper, which advances contained timestamps, many of these updates may now consolidate. We should do the work here, at the first moment, rather than downstream. The incremental cost means additional work for folks who don't need it, but the harm done to folks using TraceFrontier can be much larger.

@ggevay
Copy link

ggevay commented May 16, 2024

In the common case where the arrangement is not a retain history index, will this consolidation still do something?

Also, will this increase the memory spikes of initial hydrations where the arrangement is not a retain history index?

Copy link
Member

@antiguru antiguru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. If you're interested, we could use some of the special-casing we implemented in MaterializeInc/materialize#27136 here too.

@frankmcsherry
Copy link
Member Author

In the common case where the arrangement is not a retain history index, will this consolidation still do something?

Probably not. For an alternate approach, #490 attaches the logic to TraceFrontier, so that folks who are not importing traces will not experience any overhead.

Also, will this increase the memory spikes of initial hydrations where the arrangement is not a retain history index?

I hope not. The buffer size is going to be proportional to the longest history of any one (key, val) pair, and .. we could dial that down with a ChangeBatch style structure, which consolidates as it goes (if the history is one that consolidates down, it would be even less consequential). Though, getting ChangeBatch out of timely and into differential would be a bunch of typing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants