Keep() makes the query slow

Hi,

running latest InfluxDB 2.1.1 I have this weird performance behavior.

This query takes 3.11 seconds:

from(bucket:"statisticaldata")
  |> range(start: 2022-03-15T22:04:32.115Z, stop: 2022-03-22T22:04:32.115Z)
  |> filter(fn:(r) => r._measurement == "systemStatus")
  |> keep(columns: ["_time", "_field", "_value"])
  |> aggregateWindow(every: 5m0s, fn: max, createEmpty: false)

This query takes 0.61 seconds:

from(bucket:"statisticaldata")
  |> range(start: 2022-03-15T22:06:12.584Z, stop: 2022-03-22T22:06:12.584Z)
  |> filter(fn:(r) => r._measurement == "systemStatus")
  |> aggregateWindow(every: 5m0s, fn: max, createEmpty: false)

The result is the same as the reason I had for the keep() is gone. There is a data point in the database every 10s.

Why is keep() so slow here? It is supposed to push down.

@ypnos This is interesting. Any chance you could enable the operator profiler and include the profiler data here?

This is the operator output for the first query:

This is the operator output for the second, slow query:

And this is the output if keep() is called after aggregateWindow():

@ypnos Thanks for that. It does appear that keep() is not being pushed down.