From e7844f2efd67a42c6c83c23512e6a693316b8864 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Mon, 29 Jan 2024 18:16:49 +0100 Subject: [PATCH] docs/keyConcepts.md: clarify the information about which data is returned by instant and range queries Do not use `raw samples` term there, since it adds more confusion than clarity: the `raw samples` refers to real samples stored in the database, while neither range nor instant queries do not return raw samples - they both return *calculated* samples at *the given* timestamps. This is a follow-up for b5978ed8f9e2d46e3f1358152610a760f4359102 Updates https://github.com/VictoriaMetrics/VictoriaMetrics/pull/5710 Updates https://github.com/VictoriaMetrics/VictoriaMetrics/pull/5708 --- docs/keyConcepts.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/keyConcepts.md b/docs/keyConcepts.md index 2f02d8db2..e67afe509 100644 --- a/docs/keyConcepts.md +++ b/docs/keyConcepts.md @@ -517,8 +517,8 @@ Params: in the interval between `now()` and `now()-1m`. If omitted, `step` is set to `5m` (5 minutes). The result of Instant query is a list of [time series](https://docs.victoriametrics.com/keyConcepts.html#time-series) -matching the filter in `query` expression. Each series will have exactly one [raw sample](https://docs.victoriametrics.com/keyConcepts.html#raw-samples), -where value will contain result of `query` expression, and timestamp - the requested `time`. +matching the filter in `query` expression. Each returned series contains exactly one `(timestamp, value)` entry, +where `timestamp` equals to the `time` query arg, while the `value` contains `query` result at the requested `time`. To understand how instant queries work, let's begin with a data sample: @@ -590,7 +590,7 @@ the following scenarios: ### Range query -Range query executes the `query` expression at the given `time` range with the given `step`: +Range query executes the `query` expression at the given [`start`...`end`] time range with the given `step`: ``` GET | POST /api/v1/query_range?query=...&start=...&end=...&step=... @@ -609,9 +609,9 @@ Params: If the `step` isn't set, then it default to `5m` (5 minutes). The result of Range query is a list of [time series](https://docs.victoriametrics.com/keyConcepts.html#time-series) -matching the filter in `query` expression. Each series will have arbitrary number of [raw samples](https://docs.victoriametrics.com/keyConcepts.html#raw-samples), -where value containing result of `query` expression, and timestamp contains the moment in time at which the expression was executed. -In other words, Range query is an [Instant query](#instant-query) executed `(end-start) / step` times. +matching the filter in `query` expression. Each returned series contains `(timestamp, value)` results for the `query` executed +at `start`, `start+step`, `start+2*step`, ..., `end` timestamps. In other words, Range query is an [Instant query](#instant-query) +executed independently at `start`, `start+step`, ..., `end` timestamps. For example, to get the values of `foo_bar` during the time range from `2022-05-10 09:59:00` to `2022-05-10 10:17:00`, we need to issue a range query: