Regular time series
A regular time series stores data for regularly spaced timepoints. A regular time series is appropriate for applications that record entries at predictable timepoints, such as electricity power usage data that is recorded by smart meters every 15 minutes.
Regular time series are stored very efficiently because, instead of storing the full time stamp of an element, regular time series store the offset of the element. The offset of an element is the relative position of the element to the origin of the time series. The time stamp for an element is computed from its offset. For example, suppose you have a calendar that has an interval duration of a day. The first element, or origin, is 2011-01-02. The offset for the origin is 0. The offset for the sixth element is 5. The time stamp for the sixth element is the origin plus 5 days: 2011-01-07. The following table shows the relationship between elements and offset.
Day of the month | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
---|---|---|---|---|---|---|---|
Offset | 0 | 1 | 2 | 3 | 4 | 5 |
You can use TimeSeries SQL routines to convert between a time stamp and an offset. Some TimeSeries SQL routines require offset values as arguments. For example, you can return the 100th element in a time series with the GetNthElem function.
In a regular time series, each interval between elements is the same length. Regular elements persist only for the length of an interval as defined by the calendar associated with the time series. If a value for a timepoint is missing, that element is null. You can update null elements.