Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion content/develop/clients/patterns/indexes/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ index.

When you create a new time series using the [`TS.CREATE`]({{< relref "commands/ts.create" >}}) command, you can associate one or more `LABELS` with it. Each label is a name-value pair, where the both name and value are text. Labels serve as a secondary index that allows you to execute queries on groups of time series keys using various time series commands.

See the [time series quickstart guide]({{< relref "/develop/data-types/timeseries/quickstart#labels" >}}) for an example of creating a time series with a label.
See the [time series quickstart guide]({{< relref "/develop/data-types/timeseries#create-a-time-series" >}}) for an example of creating a time series with a label.

The [`TS.MGET`]({{< relref "commands/ts.mget" >}}), [`TS.MRANGE`]({{< relref "commands/ts.mrange" >}}), and [`TS.MREVRANGE`]({{< relref "commands/ts.mrevrange" >}}) commands operate on multiple time series based on specified labels or using a label-related filter expression. The [`TS.QUERYINDEX`]({{< relref "commands/ts.queryindex" >}}) command returns all time series keys matching a given label-related filter expression.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Headlines:
- Compression added which can reduce memory up to 98% and improve read performance up to 50%.
- Stable ingestion time independent of the number of the data points on a time-series.
- Reviewed API with performance improvements and removed ambiguity.
- Extended [client support]({{<relref "/develop/data-types/timeseries/clients">}})
- Extended [client support]({{<relref "/develop/data-types/timeseries/">}})

(we will blog about this release soon including performance improvements results and the link here)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,5 @@ To try out Redis Open Source features, follow the examples provided by the corre

- [Redis Query Engine quick start]({{< relref "/develop/get-started/document-database" >}})
- [JSON quick start]({{< relref "/develop/data-types/json/" >}}#use-redisjson)
- [Time series quick start]({{< relref "/develop/data-types/timeseries/quickstart" >}})
- [Time series quick start]({{< relref "/develop/data-types/timeseries" >}})
- [Probabilistic data structures quick start]({{< relref "/develop/data-types/probabilistic/" >}})
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ Redis Open Source provides a new data type that uses chunks of memory of fixed s
| --- | --- |
| {{< image filename="/images/rs/TimeSeries-downsampling1.png" >}} | {{< image filename="/images/rs/TimeSeries-downsampling2.png" >}} |

If you want to keep all of your raw data points indefinitely, your data set grows linearly over time. However, if your use case allows you to have less fine-grained data further back in time, downsampling can be applied. This allows you to keep fewer historical data points by aggregating raw data for a given time window using a given aggregation function. Time series support [downsampling]({{< relref "develop/data-types/timeseries/quickstart#aggregation" >}}) with the following aggregations: avg, sum, min, max, range, count, first, and last.
If you want to keep all of your raw data points indefinitely, your data set grows linearly over time. However, if your use case allows you to have less fine-grained data further back in time, downsampling can be applied. This allows you to keep fewer historical data points by aggregating raw data for a given time window using a given aggregation function. Time series support [downsampling]({{< relref "develop/data-types/timeseries#aggregation" >}}) with the following aggregations: avg, sum, min, max, range, count, first, and last.

### Secondary indexing

When using Redis’ core data structures, you can only retrieve a time series by knowing the exact key holding the time series. Unfortunately, for many time series use cases (such as root cause analysis or monitoring), your application won’t know the exact key it’s looking for. These use cases typically want to query a set of time series that relate to each other in a couple of dimensions to extract the insight you need. You could create your own secondary index with core Redis data structures to help with this, but it would come with a high development cost and require you to manage edge cases to make sure the index is correct.

Redis does this indexing for you based on `field value` pairs called [labels]({{< relref "develop/data-types/timeseries/quickstart#labels" >}}). You can add labels to each time series and use them to [filter]({{< relref "develop/data-types/timeseries/quickstart#filtering" >}}) at query time.
Redis does this indexing for you based on `field value` pairs called [labels]({{< relref "develop/data-types/timeseries#create-a-time-series" >}}). You can add labels to each time series and use them to [filter]({{< relref "develop/data-types/timeseries#query-data-points" >}}) at query time.

Here’s an example of creating a time series with two labels (sensor_id and area_id are the fields with values 2 and 32 respectively) and a retention window of 60,000 milliseconds:

Expand All @@ -56,7 +56,7 @@ Here’s an example of creating a time series with two labels (sensor_id and are

When you need to query a time series, it’s cumbersome to stream all raw data points if you’re only interested in, say, an average over a given time interval. Time series only transfer the minimum required data to ensure lowest latency.

Here's an example of [aggregation]({{< relref "develop/data-types/timeseries/quickstart#aggregation" >}}) over time buckets of 5,000 milliseconds:
Here's an example of [aggregation]({{< relref "develop/data-types/timeseries#aggregation" >}}) over time buckets of 5,000 milliseconds:

```sh
127.0.0.1:12543> TS.RANGE temperature:3:32 1548149180000 1548149210000 AGGREGATION avg 5000
Expand Down Expand Up @@ -151,7 +151,7 @@ Time series can dramatically reduce the memory consumption when compared against

## More info

- [Time series quick start]({{< relref "/develop/data-types/timeseries/quickstart" >}})
- [Time series quick start]({{< relref "/develop/data-types/timeseries" >}})
- [Time series commands]({{< relref "/operate/oss_and_stack/stack-with-enterprise/timeseries/commands" >}})
- [Time series configuration]({{< relref "/operate/oss_and_stack/stack-with-enterprise/timeseries/config" >}})
- [RedisTimeSeries source](https://github.com/RedisTimeSeries/RedisTimeSeries)
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ The following table lists time series commands. See the command links for more i
| [TS.ADD]({{< relref "commands/ts.add" >}}) | <span title="Supported">&#x2705; Supported</span><br /><span><br /></span> | <span title="Supported"><nobr>&#x2705; Flexible & Annual</nobr></span><br /><span title="Supported">&#x2705; Free & Fixed</nobr></span> | Appends a sample to a time series. |
| [TS.ALTER]({{< relref "commands/ts.alter" >}}) | <span title="Supported">&#x2705; Supported</span><br /><span><br /></span> | <span title="Supported">&#x2705; Flexible & Annual</span><br /><span title="Supported">&#x2705; Free & Fixed</nobr></span> | Updates the retention, chunk size, duplicate policy, or labels for an existing time series. |
| [TS.CREATE]({{< relref "commands/ts.create" >}}) | <span title="Supported">&#x2705; Supported</span><br /><span><br /></span> | <span title="Supported">&#x2705; Flexible & Annual</span><br /><span title="Supported">&#x2705; Free & Fixed</nobr></span> | Creates a new time series. |
| [TS.CREATERULE]({{< relref "commands/ts.createrule" >}}) | <span title="Supported">&#x2705; Supported</span><br /><span><br /></span> | <span title="Supported">&#x2705; Flexible & Annual</span><br /><span title="Supported">&#x2705; Free & Fixed</nobr></span> | Creates a compaction rule for [downsampling]({{< relref "develop/data-types/timeseries/quickstart#aggregation" >}}). |
| [TS.CREATERULE]({{< relref "commands/ts.createrule" >}}) | <span title="Supported">&#x2705; Supported</span><br /><span><br /></span> | <span title="Supported">&#x2705; Flexible & Annual</span><br /><span title="Supported">&#x2705; Free & Fixed</nobr></span> | Creates a compaction rule for [downsampling]({{< relref "develop/data-types/timeseries#aggregation" >}}). |
| [TS.DECRBY]({{< relref "commands/ts.decrby" >}}) | <span title="Supported">&#x2705; Supported</span><br /><span><br /></span> | <span title="Supported">&#x2705; Flexible & Annual</span><br /><span title="Supported">&#x2705; Free & Fixed</nobr></span> | Decreases the value of the latest sample in a time series by the specified number. Either modifies the existing sample or adds the decreased value as a new sample, depending on the timestamp option. |
| [TS.DEL]({{< relref "commands/ts.del" >}}) | <span title="Supported">&#x2705; Supported</span><br /><span><br /></span> | <span title="Supported">&#x2705; Flexible & Annual</span><br /><span title="Supported">&#x2705; Free & Fixed</nobr></span> | Removes all samples between two timestamps for a given time series. |
| [TS.DELETERULE]({{< relref "commands/ts.deleterule" >}}) | <span title="Supported">&#x2705; Supported</span><br /><span><br /></span> | <span title="Supported">&#x2705; Flexible & Annual</span><br /><span title="Supported">&#x2705; Free & Fixed</nobr></span> | Removes a compaction rule. |
| [TS.GET]({{< relref "commands/ts.get" >}}) | <span title="Supported">&#x2705; Supported</span><br /><span><br /></span> | <span title="Supported">&#x2705; Flexible & Annual</span><br /><span title="Supported">&#x2705; Free & Fixed</nobr></span> | Returns the last sample in a time series. |
| [TS.INCRBY]({{< relref "commands/ts.incrby" >}}) | <span title="Supported">&#x2705; Supported</span><br /><span><br /></span> | <span title="Supported">&#x2705; Flexible & Annual</span><br /><span title="Supported">&#x2705; Free & Fixed</nobr></span> | Increases the value of the latest sample in a time series by the specified number. Either modifies the existing sample or adds the increased value as a new sample, depending on the timestamp option. |
| [TS.INFO]({{< relref "commands/ts.info" >}}) | <span title="Supported">&#x2705; Supported</span><br /><span><br /></span> | <span title="Supported">&#x2705; Flexible & Annual</span><br /><span title="Supported">&#x2705; Free & Fixed</nobr></span> | Returns time series information and statistics. |
| [TS.MADD]({{< relref "commands/ts.madd" >}}) | <span title="Supported">&#x2705; Supported</span><br /><span><br /></span> | <span title="Supported">&#x2705; Flexible & Annual</span><br /><span title="Supported">&#x2705; Free & Fixed</nobr></span> | Appends multiple samples to one or more time series. |
| [TS.MGET]({{< relref "commands/ts.mget" >}}) | <span title="Supported">&#x2705; Supported</span><br /><span><br /></span> | <span title="Supported">&#x2705; Flexible & Annual</span><br /><span title="Supported">&#x2705; Free & Fixed</nobr></span> | Returns multiple samples with [labels]({{< relref "develop/data-types/timeseries/quickstart#labels" >}}) that match the filter. |
| [TS.MRANGE]({{< relref "commands/ts.mrange" >}}) | <span title="Supported">&#x2705; Supported</span><br /><span><br /></span> | <span title="Supported">&#x2705; Flexible & Annual</span><br /><span title="Supported">&#x2705; Free & Fixed</nobr></span> | For multiple time series, runs a query against samples within a range of timestamps, from earliest to latest. Supports [filtering]({{< relref "/develop/data-types/timeseries/quickstart" >}}#filtering) and [aggregation]({{< relref "/develop/data-types/timeseries/quickstart" >}}#aggregation). |
| [TS.MREVRANGE]({{< relref "commands/ts.mrevrange" >}}) | <span title="Supported">&#x2705; Supported</span><br /><span><br /></span> | <span title="Supported">&#x2705; Flexible & Annual</span><br /><span title="Supported">&#x2705; Free & Fixed</nobr></span> | For multiple time series, runs a query against samples within a range of timestamps in reverse order, from latest to earliest. Supports [filtering]({{< relref "/develop/data-types/timeseries/quickstart" >}}#filtering) and [aggregation]({{< relref "/develop/data-types/timeseries/quickstart" >}}#aggregation). |
| [TS.QUERYINDEX]({{< relref "commands/ts.queryindex" >}}) | <span title="Supported">&#x2705; Supported</span><br /><span><br /></span> | <span title="Supported">&#x2705; Flexible & Annual</span><br /><span title="Supported">&#x2705; Free & Fixed</nobr></span> | Returns the keys of all time series with [labels]({{< relref "/develop/data-types/timeseries/quickstart" >}}#labels) that match the given filters. |
| [TS.RANGE]({{< relref "commands/ts.range" >}}) | <span title="Supported">&#x2705; Supported</span><br /><span><br /></span> | <span title="Supported">&#x2705; Flexible & Annual</span><br /><span title="Supported">&#x2705; Free & Fixed</nobr></span> | From the start of a single time series, runs a query against samples within a range of timestamps. Supports [filtering]({{< relref "/develop/data-types/timeseries/quickstart" >}}#filtering) and [aggregation]({{< relref "/develop/data-types/timeseries/quickstart" >}}#aggregation). |
| [TS.REVRANGE]({{< relref "commands/ts.revrange" >}}) | <span title="Supported">&#x2705; Supported</span><br /><span><br /></span> | <span title="Supported">&#x2705; Flexible & Annual</span><br /><span title="Supported">&#x2705; Free & Fixed</nobr></span> | From the end of a single time series, runs a query against samples within a range of timestamps in reverse order. Supports [filtering]({{< relref "/develop/data-types/timeseries/quickstart" >}}#filtering) and [aggregation]({{< relref "/develop/data-types/timeseries/quickstart" >}}#aggregation). |
| [TS.MGET]({{< relref "commands/ts.mget" >}}) | <span title="Supported">&#x2705; Supported</span><br /><span><br /></span> | <span title="Supported">&#x2705; Flexible & Annual</span><br /><span title="Supported">&#x2705; Free & Fixed</nobr></span> | Returns multiple samples with [labels]({{< relref "develop/data-types/timeseries#create-a-time-series" >}}) that match the filter. |
| [TS.MRANGE]({{< relref "commands/ts.mrange" >}}) | <span title="Supported">&#x2705; Supported</span><br /><span><br /></span> | <span title="Supported">&#x2705; Flexible & Annual</span><br /><span title="Supported">&#x2705; Free & Fixed</nobr></span> | For multiple time series, runs a query against samples within a range of timestamps, from earliest to latest. Supports [filtering]({{< relref "/develop/data-types/timeseries#query-data-points" >}}) and [aggregation]({{< relref "/develop/data-types/timeseries#aggregation" >}}). |
| [TS.MREVRANGE]({{< relref "commands/ts.mrevrange" >}}) | <span title="Supported">&#x2705; Supported</span><br /><span><br /></span> | <span title="Supported">&#x2705; Flexible & Annual</span><br /><span title="Supported">&#x2705; Free & Fixed</nobr></span> | For multiple time series, runs a query against samples within a range of timestamps in reverse order, from latest to earliest. Supports [filtering]({{< relref "/develop/data-types/timeseries#query-data-points" >}}) and [aggregation]({{< relref "/develop/data-types/timeseries#aggregation" >}}). |
| [TS.QUERYINDEX]({{< relref "commands/ts.queryindex" >}}) | <span title="Supported">&#x2705; Supported</span><br /><span><br /></span> | <span title="Supported">&#x2705; Flexible & Annual</span><br /><span title="Supported">&#x2705; Free & Fixed</nobr></span> | Returns the keys of all time series with [labels]({{< relref "/develop/data-types/timeseries#create-a-time-series" >}}) that match the given filters. |
| [TS.RANGE]({{< relref "commands/ts.range" >}}) | <span title="Supported">&#x2705; Supported</span><br /><span><br /></span> | <span title="Supported">&#x2705; Flexible & Annual</span><br /><span title="Supported">&#x2705; Free & Fixed</nobr></span> | From the start of a single time series, runs a query against samples within a range of timestamps. Supports [filtering]({{< relref "/develop/data-types/timeseries#query-data-points" >}}) and [aggregation]({{< relref "/develop/data-types/timeseries#aggregation" >}}). |
| [TS.REVRANGE]({{< relref "commands/ts.revrange" >}}) | <span title="Supported">&#x2705; Supported</span><br /><span><br /></span> | <span title="Supported">&#x2705; Flexible & Annual</span><br /><span title="Supported">&#x2705; Free & Fixed</nobr></span> | From the end of a single time series, runs a query against samples within a range of timestamps in reverse order. Supports [filtering]({{< relref "/develop/data-types/timeseries#query-data-points" >}}) and [aggregation]({{< relref "/develop/data-types/timeseries#aggregation" >}}). |