Conversation
| } | ||
| ``` | ||
|
|
||
| | Field | Required | Purpose | |
There was a problem hiding this comment.
It may be helpful to add a column on why each field is important. Simple example and intuition will help. For e.g. I do not yet get how predictability is useful or why I must provide it.
| `PlanSpace` is Planner's canonical output. It contains: | ||
|
|
||
| * canonical workload roots; | ||
| * memo groups for discovered target sub-DAGs; |
There was a problem hiding this comment.
Is "memo" short for memoization? Should change this name
|
|
||
| Evidence is input to planning. The current library does not collect every kind | ||
| in one `PlanningWorkload` field; each fact enters through the interface that | ||
| consumes it: |
There was a problem hiding this comment.
"each fact enters through the interface that
consumes it:" -- remove. this means nothing
| `PlanSpace::cost_sorted` provides a ranked view for inspection: | ||
|
|
||
| ```text | ||
| Vec<RankedGroup { |
There was a problem hiding this comment.
What is target? Is this different from root? Also, pls define RankedGroup conceptually
| PlanSpace | ||
| | | ||
| v | ||
| global_selection |
There was a problem hiding this comment.
It would be helpful to link these to other docs where each step here or function may be described in more detail. I think you did have docs for that(?)
| and update rate are read from the optional `DataWorkload`. Missing required | ||
| facts remain unknown rather than being treated as zero. | ||
|
|
||
| `SummaryMaintenanceLifecyclePlan` additionally records: |
There was a problem hiding this comment.
Is this the output of "lifecycle-aware planning"? If so, pls mention explicitly
Also, what what is the public helper function name?
|
|
||
| It is still **not an executable deployment plan**. Physical operator binding, placement, storage, and execution remain downstream responsibilities. | ||
|
|
||
| ### Lifecycle-aware helper |
There was a problem hiding this comment.
What is the relationship between lifecycle-aware planning and "selection and materialization helper"? Can I use one but not the other? If I use both, is there a specific order to them?
|
|
||
| ### Selection and materialization helper | ||
|
|
||
| `PlanSpace::global_selection*` coordinates decisions across memo groups. |
There was a problem hiding this comment.
Not sure what this means
There was a problem hiding this comment.
Also, not sure what materialize is doing
|
|
||
| This view is useful for debugging, explanation, or downstream optimization. Candidate presence does not imply physical deployability. | ||
|
|
||
| ### Selection and materialization helper |
There was a problem hiding this comment.
Is there a single function for this? It's ok if not, but just mention that this is one function call to a public API, or multiple function calls.
| PlanSpace | ||
| -> global_selection | ||
| -> materialize | ||
| -> selected Post-ASAP DAGs |
There was a problem hiding this comment.
In the "Selection and materialization helper", the output is a single DAG but here it is multiple.
| ASAPPlanner is a **logical planning library**. Its input is a planning workload | ||
| plus the models, evidence, and deployment capabilities needed by the requested | ||
| planning workflow. Its canonical output is a `PlanSpace` containing the legal | ||
| Post-ASAP alternatives for the workload. |
There was a problem hiding this comment.
This is much clearer, thanks!
| | Input | Fields | Required | | ||
| |---|---|---:| | ||
| | `PlanningWorkload.query_workload` | Query language and one-time/repeating query workloads | Yes | | ||
| | `PlanningWorkload.data_workload` | Data arrival and optional evidence about ingestion, cardinality, and distribution | Conditional: required for PromQL; otherwise optional | |
There was a problem hiding this comment.
What is the default setting of this field?
| planning workflow. Its canonical output is a `PlanSpace` containing the legal | ||
| Post-ASAP alternatives for the workload. | ||
|
|
||
| ### Input fields at a glance |
There was a problem hiding this comment.
As far as I know, data catalog is also required. In the following table, which item contains data catalog?
| [Ranking](#ranked-view), [selection and | ||
| materialization](#selection-and-materialization-helper), and | ||
| [lifecycle](#lifecycle-aware-helper) APIs are views or helper operations over | ||
| this output, not additional top-level Planner outputs. |
There was a problem hiding this comment.
Hmm this is very interesting...
Sounds like, ASAPPlanner is providing a PlanSpace as output, along with some API functions to operate over it.
As I perceived, this implies that the output PlanSpace itself does not have any notion of lifecycle, which will only appear after you apply the lifecycle related APIs.
This somehow goes back to the question that how should users use these APIs. Is it proper for users to use it without the lifecycle API calls? If not, then why not design DAGs with the notion of lifecycle as the output?
| These inputs are supplied alongside `PlanningWorkload`, rather than nested | ||
| inside it: |
There was a problem hiding this comment.
Cool now I see where the data catalog is. But why didn't you put it into the Input table at the beginning?
| and update rate are read from the optional `DataWorkload`. Missing required | ||
| facts remain unknown rather than being treated as zero. | ||
|
|
||
| `SummaryMaintenanceLifecyclePlan` additionally records: |
There was a problem hiding this comment.
What is the relation between this SummaryMaintenanceLifecyclePlan and post-ASAP-DAG? Does the former include the latter? Or they are paralleled concept?
|
|
||
| ### Lifecycle-aware helper | ||
|
|
||
| Lifecycle-aware planning is an optional operation on an existing `PlanSpace`. |
There was a problem hiding this comment.
Why it is optional? In what scenario it is required?
|
|
||
| It is still **not an executable deployment plan**. Physical operator binding, placement, storage, and execution remain downstream responsibilities. | ||
|
|
||
| ### Lifecycle-aware helper |
There was a problem hiding this comment.
Can the helper here also select and materialize to an optimized plan? Or it must be combined with the selection and materialization helper?
|
|
||
| ## Output | ||
|
|
||
| ### `PlanSpace<Id>` |
There was a problem hiding this comment.
Actually I still don't understand why the optimal plan selection logic is not placed inside the input-to-output black box, and why not just expose one optimal plan as output.
|
|
||
| --- | ||
|
|
||
| ## Workflows |
There was a problem hiding this comment.
This is clear, thanks!
However, according to my understanding, I feel the output of ASAPPlanner should not be a PlanSpace, but should be a specific optimal plan, which can have / not have notion of lifecycle.
Since the selection and materialization seems to be applied to all downstream usages of the PlanSpace, and there is indeed no reason for user to see a space of candidates.
Another thing I feel important: We should have the logical picture and implementation separated. For example, in my opinion, I think "single optimal DAG w/ or w/o notion of lifecycle" is a better logical output, instead of the current PlanSpace. I admit there currently seems to be a gap between this logical picture and code implementation, but imo we should first get the logical picture clear and straight, and use that as a guide to fix the code.
| ### Output at a glance | ||
|
|
||
| | Output | Fields or contents | Meaning | | ||
| |---|---|---| | ||
| | `PlanSpace<Id>` | The legal candidate Post-ASAP DAGs for the workload, represented compactly as canonical roots, memoized alternatives, and cross-group composition information | The ASAPPlanner output | | ||
|
|
||
| [Ranking](#ranked-view), [selection and | ||
| materialization](#selection-and-materialization-helper), and | ||
| [lifecycle](#lifecycle-aware-helper) APIs are views or helper operations over | ||
| this output, not additional top-level Planner outputs. |
There was a problem hiding this comment.
Just realized that output described here is inconsistent with what is written in the docs/design_docs/architecture/README.md diagram. This is not good, and please double check!
Why
Issue #438 shows that the current documentation exposes individual planner stages without first defining the supported end-to-end integration workflow. Callers cannot easily tell which inputs are required, when lifecycle planning is necessary, or whether
PlanSpace, a ranked group, or a materialized DAG is the final output. Related terminology and API-surface ambiguity is tracked in #427, and #428.Before this PR
A caller could discover
search_workload*,cost_sorted,global_selection, and lifecycle APIs independently and reasonably conclude that each was a separate valid end state. For example, a recurring summary could be structurally selected without making clear that this does not establish that maintaining it is cheaper than exact recomputation. Window semantics, summary frameworks, physical layouts, window edges, and physical handoffs were also easy to conflate.After this PR
The design documentation starts from one outer workflow: canonical roots and requirements enter ASAPPlanner, and
PlanSpaceis the canonical logical output. It then explicitly documents:PlanSpace, ranked views, materialized DAGs, and lifecycle-aware outputs;The lifecycle-aware workflow is identified as the recommended path before claiming that maintained summary state is preferable to raw execution. Physical binding, deployment, transitions, and execution remain downstream responsibilities. The document also states that public Rust visibility does not automatically make a type part of the recommended integration surface.
Validation
git diff --checkCloses #438
Related to #427 and #428
Related to ProjectASAP/ASAPQuery-backend#734