How can I quickly query the latest 50 records from a bucket when I don’t know when the most recent data was inserted? The latest data could be from a day ago, a month ago, or even a year or two ago.
You typically need to scan a large time range because Flux requires a time range for every query so for example something like this:
from(bucket: “your-bucket”)
|> range(start: 2000-01-01T00:00:00Z, stop: now())
|> sort(columns: [“_time”], desc: true)
|> limit(n: 50)
Will scanning a larger time range cause poor performance?
Only way to find out is to try ![]()
