influxdata / influxdata/influxdb
Using last() shows the current time minus whatever the time range is set to
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 31.7k
- Forks
- 3.7k
- Avg merge
- 13h 37m
- Merged PRs (30d)
- 8
Description
InfluxDB version 1.8.5
Using a query with `last(*)` makes the Time column show the current time minus whatever the time range is set to.
Running the following query:
```
SELECT last(*) FROM "minioConnectivity" WHERE $timeFilter GROUP BY "minioConnectivity-key"
```
Shows the following:

Which is the current time - 30 mins (my current time range). If I keep refreshing the page it will keep updating alongside the current time. If I change my time range it updates to current time minus that value, i.e its not actually showing the value inside the DB
If I remove the call to `last()` I get the correct time which is stored in the DB.

Any ideas why this is happening?
EDIT: Remove the time filter makes it show epoch-time=0. So it must be related to https://github.com/influxdata/docs.influxdata.com-ARCHIVE/issues/2153
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the behavior in InfluxDB 1.8.5 with the shown last(*) query, both with and without $timeFilter, and compare the displayed time with the stored value. Read the linked archived issue about the time filter; done means last(*) reports the database timestamp rather than a value derived from the selected range.
Written by the indexing model from the issue text.
Assessment
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100