You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
YugaByte's Redis API introduces a timeseries (TS) type with operations such as: TSAdd, TSRangeByTime, and TSGet and TSRem.
In particular, TSRangeByTime can be used to retrieve a slice of the timeseries corresponding to the specified range of timestamps. In addition to TSRangeByTime, it'll be useful to add a mechanism to fetch the data points of a timeseries N elements a time.
Given that the natural order in which the data points are stored in DocDB is from highest timestamp to lowest, the proposal is to add a:
TSRevRangeByTime key low_ts high_ts [LIMIT N]
This will return the results in high to low TS order, but up to a max of N elements.
When the response returns fewer than N data points, it signals the end of the scan.
Using the above, it will be possible to scan through the data points of a timeseries key in the following manner:
Say you want tofetch data from highest timestamp to lowest timestamp 100 elements at time, all that an app would have to do would be to start with:
where the left-paren "(" signifies an exclusive bound (which is a standard Redis idoim).
(Note: For symmetry, we should eventually also enhance TSRangeByTime with a LIMIT clause; but we could defer that till we actually implement reverse scans in DocDB for our Redis data model.)
The text was updated successfully, but these errors were encountered:
Summary: #170
Test Plan: New unit test
Reviewers: kannan, rahuldesirazu, pritam.damania
Reviewed By: pritam.damania
Subscribers: ybase
Differential Revision: https://phabricator.dev.yugabyte.com/D4639
YugaByte's Redis API introduces a timeseries (TS) type with operations such as: TSAdd, TSRangeByTime, and TSGet and TSRem.
In particular, TSRangeByTime can be used to retrieve a slice of the timeseries corresponding to the specified range of timestamps. In addition to TSRangeByTime, it'll be useful to add a mechanism to fetch the data points of a timeseries N elements a time.
Given that the natural order in which the data points are stored in DocDB is from highest timestamp to lowest, the proposal is to add a:
TSRevRangeByTime key low_ts high_ts [LIMIT N]
This will return the results in high to low TS order, but up to a max of N elements.
When the response returns fewer than N data points, it signals the end of the scan.
Using the above, it will be possible to scan through the data points of a timeseries key in the following manner:
Say you want tofetch data from highest timestamp to lowest timestamp 100 elements at time, all that an app would have to do would be to start with:
TSRevRangeByTime key -inf +inf LIMIT 100
and then follow it up with subsequent calls:
TSRevRangeByTime key -inf (<lowest_ts_received_from_previous_call> LIMIT 100
where the left-paren "(" signifies an exclusive bound (which is a standard Redis idoim).
(Note: For symmetry, we should eventually also enhance TSRangeByTime with a LIMIT clause; but we could defer that till we actually implement reverse scans in DocDB for our Redis data model.)
The text was updated successfully, but these errors were encountered: