Document time filter necessity for sub queries

Open Beginner friendly
#1,173 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Quiet
Tech stack
grafana
Domain
documentation

Research direction

Start with the official LogsQL documentation for time filters and sub-queries, then review how queries are submitted through the API, CLI and vmalert. Compare the documented behavior with Grafana or vmui usage, and consider the issue complete when the time-filter caveat and its performance implication are clearly documented.

Written by the indexing model from the issue text.

Description

documentation enhancement logsql
Is your feature request related to a problem? Please describe

Suppose you write a query that has sub-queries, such as _time:5m <main query> | join by (<column>) (<sub query>) inner. If executing this query, e.g., via API, CLI or vmalert, the time range filter is only applied to the main query, not to the sub query. This causes unexpected performance issues (because the sub-query runs without any time filter constraints), especially if users already tested such queries in Grafana or vmui first, where the visually-provided time ranges do also apply to the sub-queries, thus avoiding these performance problems.

Describe the solution you'd like

Either you change VLogs behavior to also apply a provided time range filter to sub-queries automatically, or you document this behavior as a caveat in the official docs.

Describe alternatives you've considered

No response

Additional information

No response

Dominant language
Go
Stars
2.3k
Forks
194
Avg merge
6d 6h
Merged PRs (30d)
22

Contributor guide

Open the contributing guide

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.

More from VictoriaMetrics/VictoriaLogs

All issues in VictoriaMetrics/VictoriaLogs

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.