-
Notifications
You must be signed in to change notification settings - Fork 468
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
design: A unified optimizer interface #20569
design: A unified optimizer interface #20569
Conversation
Adding a comment to put some extra items that I would like to discuss and nail in this doc:
For example, we want to communicate notices the optimizer back to the caller (the
P.S.: Sadly, even if we had this the fact that |
a2d6f8b
to
ad73d39
Compare
f5854ba
to
d21d02c
Compare
d21d02c
to
f5620f6
Compare
its client sites ("bootstrap `T`", "execute `T`", and "explain `T`") therefore | ||
is constantly at risk of getting out of sync. When this happens, it negatively | ||
impacts the overall product experience. For example, in the past we had | ||
situations with "`EXPLAIN` drift", where "explain `SELECT`" results wre not |
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.
BTW this is the case even now because "execute SELECT
" statements produce a dataflow with an exported IndexDesc
that we don't create in the "explain SELECT
".
materialize/src/adapter/src/coord/sequencer/inner.rs
Lines 2319 to 2326 in 10ae7a9
dataflow.export_index( | |
index_id, | |
IndexDesc { | |
on_id: view_id, | |
key: key.clone(), | |
}, | |
typ.clone(), | |
); |
It's not something that currently affects the EXPLAIN
output, but still...
0ed9a4d
to
82f86ac
Compare
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.
So well written and explained. This looks great! Excited to see this happen.
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.
LGTM!
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.
Looks great!
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.
Thanks for all this work and extra detail!
82f86ac
to
d7ce174
Compare
Introduce `OptimizePeek` in the `sequence_peek` optimization paths in the `Coordinator`. See the rollout proposal in MaterializeInc#20569 for details.
Introduce `OptimizePeek` in the `sequence_explain_plan` optimization path for `Query` explainees in the `Coordinator`. See the rollout proposal in MaterializeInc#20569 for details.
Fork the old implementations of - `Coordinator::sequence_peek*`, and - `Coordinator::explain_query_optimizer_pipeline`, by duplicating code and dispatching between the old and the new code path based on the value of the `enable_unified_optimizer_api` feature flag. At the moment the two code paths are still identical, but this will change with the next commit. See the rollout proposal in MaterializeInc#20569 for details.
Introduce `OptimizePeek` in the `sequence_peek` optimization paths in the `Coordinator`. See the rollout proposal in MaterializeInc#20569 for details.
Introduce `OptimizePeek` in the `sequence_explain_plan` optimization path for `Query` explainees in the `Coordinator`. See the rollout proposal in MaterializeInc#20569 for details.
Fork the old implementations of - `Coordinator::sequence_peek*`, and - `Coordinator::explain_query_optimizer_pipeline`, by duplicating code and dispatching between the old and the new code path based on the value of the `enable_unified_optimizer_api` feature flag. At the moment the two code paths are still identical, but this will change with the next commit. See the rollout proposal in MaterializeInc#20569 for details.
Introduce `OptimizePeek` in the `sequence_peek` optimization paths in the `Coordinator`. See the rollout proposal in MaterializeInc#20569 for details.
Introduce `OptimizePeek` in the `sequence_explain_plan` optimization path for `Query` explainees in the `Coordinator`. See the rollout proposal in MaterializeInc#20569 for details.
Fork the old implementations of - `Coordinator::sequence_peek*`, and - `Coordinator::explain_query_optimizer_pipeline`, by duplicating code and dispatching between the old and the new code path based on the value of the `enable_unified_optimizer_api` feature flag. At the moment the two code paths are still identical, but this will change with the next commit. See the rollout proposal in MaterializeInc#20569 for details.
Introduce `OptimizePeek` in the `sequence_peek` optimization paths in the `Coordinator`. See the rollout proposal in MaterializeInc#20569 for details.
Introduce `OptimizePeek` in the `sequence_explain_plan` optimization path for `Query` explainees in the `Coordinator`. See the rollout proposal in MaterializeInc#20569 for details.
Fork the old implementations of - `Coordinator::sequence_peek*`, and - `Coordinator::explain_query_optimizer_pipeline`, by duplicating code and dispatching between the old and the new code path based on the value of the `enable_unified_optimizer_api` feature flag. At the moment the two code paths are still identical, but this will change with the next commit. See the rollout proposal in MaterializeInc#20569 for details.
Introduce `OptimizePeek` in the `sequence_peek` optimization paths in the `Coordinator`. See the rollout proposal in MaterializeInc#20569 for details.
Introduce `OptimizePeek` in the `sequence_explain_plan` optimization path for `Query` explainees in the `Coordinator`. See the rollout proposal in MaterializeInc#20569 for details.
Fork the old implementations of - `Coordinator::sequence_peek*`, and - `Coordinator::explain_query_optimizer_pipeline`, by duplicating code and dispatching between the old and the new code path based on the value of the `enable_unified_optimizer_api` feature flag. At the moment the two code paths are still identical, but this will change with the next commit. See the rollout proposal in MaterializeInc#20569 for details.
Introduce `OptimizePeek` in the `sequence_peek` optimization paths in the `Coordinator`. See the rollout proposal in MaterializeInc#20569 for details.
Introduce `OptimizePeek` in the `sequence_explain_plan` optimization path for `Query` explainees in the `Coordinator`. See the rollout proposal in MaterializeInc#20569 for details.
Fork the old implementations of - `Coordinator::sequence_peek*`, and - `Coordinator::explain_query_optimizer_pipeline`, by duplicating code and dispatching between the old and the new code path based on the value of the `enable_unified_optimizer_api` feature flag. At the moment the two code paths are still identical, but this will change with the next commit. See the rollout proposal in MaterializeInc#20569 for details.
Introduce `OptimizePeek` in the `sequence_peek` optimization paths in the `Coordinator`. See the rollout proposal in MaterializeInc#20569 for details.
Introduce `OptimizePeek` in the `sequence_explain_plan` optimization path for `Query` explainees in the `Coordinator`. See the rollout proposal in MaterializeInc#20569 for details.
Fork the old implementations of - `Coordinator::sequence_peek*`, and - `Coordinator::explain_query_optimizer_pipeline`, by duplicating code and dispatching between the old and the new code path based on the value of the `enable_unified_optimizer_api` feature flag. At the moment the two code paths are still identical, but this will change with the next commit. See the rollout proposal in MaterializeInc#20569 for details.
Introduce `OptimizePeek` in the `sequence_peek` optimization paths in the `Coordinator`. See the rollout proposal in MaterializeInc#20569 for details.
Introduce `OptimizePeek` in the `sequence_explain_plan` optimization path for `Query` explainees in the `Coordinator`. See the rollout proposal in MaterializeInc#20569 for details.
Introduce `OptimizeView` in the `CREATE INDEX` optimization paths in the `Coordinator`, `Catalog`, and `CatalogState` implementations: - `CatalogState::parse_view_item` (the `Plan::CreateView` part), - `CatalogState::parse_item` (the `Plan::CreateView` part). - `Coordinator::sequence_create_view`. - `Coordinator::sequence_explain_timestamp_begin_inner`. - `Coordinator::sequence_insert`. See the rollout proposal in #20569 for details.
Fork the old implementations of `Coordinator::sequence_subscribe` by duplicating code and dispatching between the old and the new code path based on the value of the `enable_unified_optimizer_api` feature flag. At the moment the two code paths are still identical, but this will change with the next commit. See the rollout proposal in #20569 for details.
Introduce `OptimizeSubscribe` in the `SUBSCRIBE` optimization paths in the `Coordinator::sequence_subscribe` implementation. See the rollout proposal in #20569 for details.
Fork the old implementations of - `Coordinator::sequence_peek*`, and - `Coordinator::explain_query_optimizer_pipeline`, by duplicating code and dispatching between the old and the new code path based on the value of the `enable_unified_optimizer_api` feature flag. At the moment the two code paths are still identical, but this will change with the next commit. See the rollout proposal in #20569 for details.
Introduce `OptimizePeek` in the `sequence_peek` optimization paths in the `Coordinator`. See the rollout proposal in #20569 for details.
Introduce `OptimizePeek` in the `sequence_explain_plan` optimization path for `Query` explainees in the `Coordinator`. See the rollout proposal in #20569 for details.
We have talked off and on about unifying the interface to the optimizer. This design doc discusses why that would be useful and what it would look like.
Markdown rendering of
Motivation
Tips for reviewer
Conspicuously absent: the actual proposed interface. I think this is best discussed at the next on-site.
Checklist
$T ⇔ Proto$T
mapping (possibly in a backwards-incompatible way), then it is tagged with aT-proto
label.