Skip to content

Commit

Permalink
Add changelog entry for split by range of instant queries (#5966)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssncferreira committed Apr 21, 2022
1 parent c0f51b9 commit ea59e4b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 2 additions & 5 deletions pkg/logql/rangemapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand All @@ -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
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit ea59e4b

Please sign in to comment.