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

Build view combining raw data and incremental rollup #3

Open
cleaton opened this issue Dec 18, 2024 · 3 comments
Open

Build view combining raw data and incremental rollup #3

cleaton opened this issue Dec 18, 2024 · 3 comments

Comments

@cleaton
Copy link

cleaton commented Dec 18, 2024

Hi, thanks for the great extension.

is it possible to build pipelines in a way that enables “real-time” aggregates? For example by combining latest raw data and pre-aggregates:

‘’’
select * from view_counts where ts <= last_incremental_update
union all
select (aggregates that created view_counts) from raw_views where ts > last_incremental_update
‘’’

@marcoslot
Copy link
Collaborator

You could join with the incremental.sequence_pipelines or incremental.time_interval_pipelines tables to obtain the last_incremental_update value. You typically only need to filter the raw data, since the view_counts is not going to contain anything more recent than that.

@cleaton
Copy link
Author

cleaton commented Dec 18, 2024

Is it ok to replace the view as part of the incremental transaction or is that not recommended / supported? I’m even thinking if it would be possible to have it as an optional feature to build realtime view that hides the internal incremental process latency.

@marcoslot
Copy link
Collaborator

I guess it's possible, might have some locking implications. Definitely an interesting feature to think about. Maybe a stable function that returns the last processed value already goes a long way, as long as we can use it with an index scan.

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

No branches or pull requests

2 participants