-
Notifications
You must be signed in to change notification settings - Fork 51
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
Stats agg #141
Conversation
```SQL | ||
moving_average(window => '30 minutes', slide => '5 minutes', data) | ||
``` | ||
However, because set-returning aggregates cannot not exist in Postgres, this will not work outside of the timeseries API. Currently, doing rolling average properly requires windowed aggregates. In base SQL it is a real PITA because you have to do sum and count separately and then divide them yourself. |
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.
We should probably also think about the continuous aggregate implications ie #138 in this document.
|
||
#[pg_extern(schema = "timescale_analytics_experimental")] | ||
pub fn stats1d_summary_trans<'s, 'v>( | ||
state: Option<Internal<StatsSummary1D<'s>>>, |
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.
It seems like the logic of all of these pg aggregate functions would be streamlined if the internal representation was a StatsSummary1DInternal
. This would require a separate trans function for the rollup, but still seems like it might be cleaner.
bors r+ |
Build succeeded: |
No description provided.