-
Notifications
You must be signed in to change notification settings - Fork 228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perf(query): reduce regex query fanout #1644
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alextheimer Query Stats need to be keyed with "multiple-ns" for the namespace field for NS-Regex queries within partition.
@vishramachandran it looks like the latest
|
coordinator/src/main/scala/filodb.coordinator/queryplanner/LogicalPlanUtils.scala
Outdated
Show resolved
Hide resolved
11d683e
to
adb4ce2
Compare
dcb2340
to
466ac9c
Compare
466ac9c
to
0cf4aee
Compare
0cf4aee
to
67474ab
Compare
67474ab
to
2b62db8
Compare
coordinator/src/test/scala/filodb.coordinator/queryplanner/ShardKeyRegexPlannerSpec.scala
Outdated
Show resolved
Hide resolved
coordinator/src/main/scala/filodb.coordinator/queryplanner/MultiPartitionPlanner.scala
Outdated
Show resolved
Hide resolved
coordinator/src/main/scala/filodb.coordinator/queryplanner/MultiPartitionPlanner.scala
Outdated
Show resolved
Hide resolved
coordinator/src/main/scala/filodb.coordinator/queryplanner/MultiPartitionPlanner.scala
Outdated
Show resolved
Hide resolved
coordinator/src/test/scala/filodb.coordinator/queryplanner/MultiPartitionPlannerSpec.scala
Outdated
Show resolved
Hide resolved
} | ||
|
||
// // TODO: what is this the purpose of this test? The lookback is 300s, and the assignment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why comment out the test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was hoping others would know what this test was for-- it looks like we used to expect partition-split plans would always return at least one data-point per partition, regardless of lookback/offset. That doesn't jive with the way we handle partition-splits elsewhere in the planners, so I think this test should be removed.
The reason it passed prior to this PR is because the MPP sent PeriodicSeries
and RawSeries
through the old materializePeriodicAndRawSeries
logic. That always materialized at least one plan per partition.
materializePeriodicAndRawSeries
was built to materialize plans with equality-only filters, so that would not work for this PR. Instead, plans are:
- if split, passed to the regex-handling
materializeSplitLeafPlan
, which accounts correctly for lookback. - if not split, forwarded as-is to any partitions that own the query data.
coordinator/src/main/scala/filodb.coordinator/queryplanner/QueryUtils.scala
Show resolved
Hide resolved
coordinator/src/test/scala/filodb.coordinator/queryplanner/MultiPartitionPlannerSpec.scala
Outdated
Show resolved
Hide resolved
coordinator/src/test/scala/filodb.coordinator/queryplanner/ShardKeyRegexPlannerSpec.scala
Show resolved
Hide resolved
Co-authored-by: Amol Nayak <[email protected]>
This reverts commit 2054a7f.
Pull Request checklist
Currently, the
ShardKeyRegexPlanner
asks its inner planner to create anExecPlan
for each one of aLogicalPlan
's shard keys. This is inefficient; if 100 shard keys are matched but all data lies on only two partitions, it would be much more efficient to instead ask the inner planner to materialize one plan per partition.This PR materializes
ExecPlan
s in this more-efficient manner. TheShardKeyRegexPlanner
now passesLogicalPlans
with original regex filters to lower-level planners. TheMultiPartitionPlanner
now has infrastructure added to resolve shard-keys and determine the partitions to be queried; it now materializes plans per-partition (instead of per-shard-key). Again, regex is passed to lower-level planners; theSingleClusterPlanner
now also has the infrastructure to materialize regex-filtered plans.