Reimplement old planner rules in new planner
This commit shows the old rules: https://github.com/influxdata/flux/commit/4cce9948886e1d8d1b8e25aa5add2821fa266998
Rules that need re-implementing are:
-
filterrules (push through group, limit, merge with another filter) -
first(and other selector) push down rules -
keyspoint limit rule -
limitpush down rules (what can you push a limit through?) -
rangepush down rules
We should come up with a canonical way of ordering operations that models how storage performs those operations. It seems like this should be:
- Range
- Filter
- Grouping
- Limit (point, series)
- Window
- Aggregate
In other words, we should write rules that produce plans with operations in this order if that's possible to do in a way that preserves semantics.
For push down rules, there should be one rule for each type of node that can be pushed through. E.g., filters may be pushed through a group node or a limit node, so there should be both a PushFilterThroughGroupRule and a PushFilterThroughLimitRule.
Push down rules should live in the file for the node being pushed through. So PushFilterThroughLimitRule should live in transformations/limit.go.
We should do this, but there is no reason we can't release an update after we GA with these improvement.