diff --git a/CHANGELOG.md b/CHANGELOG.md index 16d41db68908..a1799c097baf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * [5780](https://github.com/grafana/loki/pull/5780) **simonswine**: Update alpine image to 3.15.4. * [5715](https://github.com/grafana/loki/pull/5715) **chaudum** Add option to push RFC5424 syslog messages from Promtail in syslog scrape target. * [5696](https://github.com/grafana/loki/pull/5696) **paullryan** don't block scraping of new logs from cloudflare within promtail if an error is received from cloudflare about too early logs. +* [5662](https://github.com/grafana/loki/pull/5662) **ssncferreira** **chaudum** Improve performance of instant queries by splitting range into multiple subqueries that are executed in parallel. * [5685](https://github.com/grafana/loki/pull/5625) **chaudum** Fix bug in push request parser that allowed users to send arbitrary non-string data as "log line". * [5707](https://github.com/grafana/loki/pull/5707) **franzwong** Promtail: Rename config name limit_config to limits_config. * [5626](https://github.com/grafana/loki/pull/5626) **jeschkies** Support multi-tenant select logs and samples queries. diff --git a/pkg/logql/rangemapper.go b/pkg/logql/rangemapper.go index 1051c73cf7d9..f7ac61d82488 100644 --- a/pkg/logql/rangemapper.go +++ b/pkg/logql/rangemapper.go @@ -47,7 +47,7 @@ var splittableRangeVectorOp = map[string]struct{}{ // that are merged with vector aggregation using "without" and then aggregated // using the vector aggregation with the same operator, // either with or without grouping. -// 5) Left and right hand side of binary operations are split individually +// 5) Left and right-hand side of binary operations are split individually // using the same rules as above. type RangeMapper struct { splitByInterval time.Duration @@ -263,7 +263,6 @@ func (m RangeMapper) mapVectorAggregationExpr(expr *syntax.VectorAggregationExpr // in case the interval is smaller than the configured split interval, // don't split it. - // TODO: what if there is another internal expr with an interval that can be split? if rangeInterval <= m.splitByInterval { return expr, nil } @@ -272,8 +271,6 @@ func (m RangeMapper) mapVectorAggregationExpr(expr *syntax.VectorAggregationExpr // we can push down the outer vector aggregation to the downstream query. // This does not work for `count()` and `topk()`, though. // We also do not want to push down, if the inner expression is a binary operation. - // TODO: Currently, it is sending the last inner expression grouping dowstream. - // Which grouping should be sent downstream? var vectorAggrPushdown *syntax.VectorAggregationExpr if _, ok := expr.Left.(*syntax.BinOpExpr); !ok && expr.Operation != syntax.OpTypeCount && expr.Operation != syntax.OpTypeTopK { vectorAggrPushdown = expr @@ -342,7 +339,7 @@ func (m RangeMapper) mapRangeAggregationExpr(expr *syntax.RangeAggregationExpr, // supported and the inner expression is also splittable. // A range aggregation is splittable, if the aggregation operation is // supported. -// A binary expression is splittable, if both the left and the right hand side +// A binary expression is splittable, if both the left and the right-hand side // are splittable. func isSplittableByRange(expr syntax.SampleExpr) bool { switch e := expr.(type) {