Skip to content
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

[DNM]: Cluster-specific Optimize pipelines MVP #25165

Conversation

aalexandrov
Copy link
Contributor

WIP branch for the current prototype of the design proposed in #25010.

Motivation

  • This PR adds a known-desirable feature.

This is a draft PR meant to facilitate discussion of implementation details related to the design proposed in #25010.

Tips for reviewer

Do not review this, unless I specifically ask you to look at certain parts for high-level feedback.

Checklist

  • This PR has adequate test coverage / QA involvement has been duly considered.
  • This PR has an associated up-to-date design doc, is a design doc (template), or is sufficiently small to not require a design.
  • If this PR evolves an existing $T ⇔ Proto$T mapping (possibly in a backwards-incompatible way), then it is tagged with a T-proto label.
  • If this PR will require changes to cloud orchestration or tests, there is a companion cloud PR to account for those changes that is tagged with the release-blocker label (example).
  • This PR includes the following user-facing behavior changes:

@aalexandrov aalexandrov force-pushed the cluster_specific_optimization branch 5 times, most recently from 8143009 to 8476351 Compare February 12, 2024 16:21
@aalexandrov aalexandrov changed the title [DNM]: Cluser-specific optimization WIP [DNM]: Cluser-specific optimization MVP Feb 13, 2024
@aalexandrov aalexandrov force-pushed the cluster_specific_optimization branch from 8476351 to db0af85 Compare February 13, 2024 09:34
@nrainer-materialize nrainer-materialize changed the title [DNM]: Cluser-specific optimization MVP [DNM]: Cluster-specific optimization MVP Feb 13, 2024
@aalexandrov aalexandrov force-pushed the cluster_specific_optimization branch 22 times, most recently from d987f6b to 5ba3d42 Compare February 19, 2024 15:05
@aalexandrov aalexandrov force-pushed the cluster_specific_optimization branch 14 times, most recently from 73c3a44 to bebe890 Compare February 27, 2024 16:33
Forcing `DataflowBuilder::reoptimize_imported_views` to reoptimize all
catalog-backed views imported in the `DataflowDescription` in every
possible `EXPLAIN` run is a bit of an overkill.

Instead, we should enable work in this method call only when one of the
overrides of `OptimizerConfig` (`CREATE CLUSTER ... FEATURES(...)` or
`EXPLAIN PLAN WITH(...)`) explicitly sets the value of a feature flag
that influences an optimizer stage that runs before we produce the
locally optimized `MirRelationExpr`.

To do this, we introduce a dedicated optimizer feature flag for that.
Engineers should enable this flag in conjunction with any other flags
that modify the view optimization pipeline in order to see differences
in catalog items that depend on the view.
Design doc for the #25273 epic.
Add parser and planner support for the following `EXPLAIN ... VIEW`
statements:

- `EXPLAIN CREATE VIEW ...`
- `EXPLAIN REPLAN VIEW ...`
- `EXPLAIN VIEW ...`

To do this, introduce new enum variants `ExplainStage::LocalPlan` and
`NamedPlan::Local` that correspond to the `optimize/local` stage and
teach the parser to default to this stage for the above variants if an
explicitly defined stage is not present.
Add coordinator support for sequencing the following `EXPLAIN ... VIEW`
statements:

- `EXPLAIN CREATE VIEW ...`
- `EXPLAIN REPLAN VIEW ...`
- `EXPLAIN VIEW ...`
Move `explain_materialized_view` to `inner/create_materialized_view.rs`.
Move `explain_index` to `inner/create_index.rs`.
Add support for handling the `RAW` and `LOCALLY OPTIMIZED` stages
using the plans stored in the catalog entry (as in `EXPLAIN VIEW`).
@aalexandrov aalexandrov force-pushed the cluster_specific_optimization branch from bebe890 to 71fa86d Compare February 28, 2024 14:23
@aalexandrov aalexandrov self-assigned this Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant