Timescale's time weighted average is implemented as an aggregate that weights each value using last observation carried forward (LOCF), or linear interpolation. The aggregate is not parallelizable, but it is supported with continuous aggregation.
In this procedure, we are using an example table called
contains data about internal freezer temperatures.
psqlprompt, find the average and the time-weighted average of the data:
To determine if the freezer has been out of temperature range for more than 15 minutes at a time, use a time-weighted average in a window function:
For more information about time-weighted average API calls, see the hyperfunction API documentation.
Found an issue on this page?Report an issue!