Skip to content

Commit 525ed6a

Browse files
TS.CREATE - explain duplicate policies (#529)
* TS.CREATE - explain duplicate policies * Update content/commands/ts.create/index.md Co-authored-by: David Dougherty <david.dougherty@redis.com> --------- Co-authored-by: David Dougherty <david.dougherty@redis.com>
1 parent dd0908a commit 525ed6a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

content/commands/ts.create/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ is policy for handling insertion ([`TS.ADD`]({{< baseurl >}}/commands/ts.add/) a
149149
- `SUM`: If a previous sample exists, add the new sample to it so that the updated value is equal to (previous + new). If no previous sample exists, set the updated value equal to the new value.
150150

151151
When not specified: set to the global [DUPLICATE_POLICY]({{< baseurl >}}/develop/data-types/timeseries/configuration#duplicate_policy) configuration of the database (which, by default, is `BLOCK`).
152+
153+
`BLOCK` is often used to avoid accidental changes. `FIRST` can be used as an optimization when duplicate reports are possible. `LAST` can be used when updates are being reported. `SUM` is used for counters (e.g., the number of cars entering a parking lot per minute when there are multiple reporting counting devices). `MIN` and `MAX` can be used, for example, to store the minimal/maximal stock price per minute (instead of storing all the samples and defining a compaction rule).
154+
152155
</details>
153156

154157
<details open><summary><code>IGNORE ignoreMaxTimediff ignoreMaxValDiff</code></summary>

0 commit comments

Comments
 (0)