influxdata / influxdata/docs-v2

Improve documentation for grouping by time

Open
#1,497 2 comments 0 reactions 1 assignee View on GitHub

@sanderson is already working on this.

Since Jan 10, 2020.

InfluxQL product:v1
Dominant language
JavaScript
Stars
82
Forks
326
Avg merge
1d 1h
Merged PRs (30d)
82

Description

This is for InfluxDB 1.x. I was surprised recently to discover that when I do a query using a time range as a where criteria and group by 10 seconds, InfluxDB locks the time windows to 00,10,20,30,40,50 seconds on the clock. What I expected to happen was that it would use 10 second windows starting from the timestamp of the beginning timestamp in the where clause.

In other words, if I did a query with a where and group like: _where time >= '2020-01-02T01:02:01.000000Z' and time < '2020-01-02T01:07:01.000000Z' GROUP BY time(10000ms), "host" FILL(0)_ the time windows will NOT be 01:02:01-01:02:11, 01:02:11-01:02:21, etc but instead will be 01:02:00-01:02:10, 01:02:10-01:02:20, etc.

This caused a strange behavior in an export script that exported data in chunks of 5 minute windows due to memory constraints, but the last data set it retrieved from InfluxDB would consistently be all 0s (due to the fill) because the window it was looking over would be very small and there would be no data recorded in it.

The documentation about group by time is pretty good, but all of the examples use 00 seconds as the start time, so it would be good to add some extra documentation around this behavior.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.