You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 49c5187
Browse filesBrowse the repository at this point in the historyBrowse files
docs: describe the stage pipeline instead of the removed legacy search
Library API, architecture overview, planner pipeline and the accuracy
and cost developer docs now describe the #509 stage pipeline. Docs
that only describe removed APIs (legacy search, CostModel,
explanation, physical-plan cost adapter) are marked historical.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,13 @@
1
1
# ASAPPlanner
2
2
3
-
ASAPPlanner turns SQL, PromQL, and MetricsQL query workloads into legal candidate plans that may use Approximate Streaming Analytics Primitives (ASAPs), such as sketches and exact summaries. It normalizes language-specific queries into a shared representation, then enumerates and ranks semantically equivalent alternatives. Downstream systems choose, deploy, and execute a physical plan.
3
+
ASAPPlanner turns SQL, PromQL, and MetricsQL query workloads into plans that may use Approximate Streaming Analytics Primitives (ASAPs), such as sketches and exact summaries. It normalizes language-specific queries into a shared representation, enumerates semantically equivalent alternatives, and selects the cheapest one that meets each query's accuracy target. Downstream systems deploy and execute the physical plan.
4
4
5
5
## Start here
6
6
7
7
- New to the repository? Read the [planner pipeline](docs/design_docs/concepts/planner-pipeline.md), then the [glossary](docs/design_docs/concepts/glossary.md).
8
8
- Want to run a query? Follow [Run and inspect a query](docs/user_guide_docs/run-a-query.md).
9
9
- Embedding Planner? Use the [library API guide](docs/develop_docs/library-api.md).
10
-
- Extending Planner? Start with the [ASAP-aware mapping architecture](docs/develop_docs/asap-aware-mapping-architecture.md), then [extend ASAP-aware mapping](docs/develop_docs/extend-asap-aware-mapping.md).
10
+
- Extending Planner? Start with the [ASAP-aware mapping architecture](docs/develop_docs/asap-aware-mapping-architecture.md).
11
11
- Evaluating a design? Browse the [design documentation](docs/design_docs/README.md), [developer documentation](docs/develop_docs/README.md), and [user guides](docs/user_guide_docs/README.md).
12
12
13
13
The [documentation map](docs/README.md) gives each audience a complete reading path.
S3["Stage 3: accuracy and capability checks, pricing, selection"]
25
+
PLAN["Selected logical Post-ASAP plan + selection report"]
26
+
BACKEND["Downstream: bind physical operators, deploy, compile and execute"]
27
27
W --> PRE
28
28
F --> PRE
29
-
PRE --> SEARCH
30
-
E --> SEARCH
31
-
SEARCH --> SPACE
32
-
SPACE --> RANK --> BACKEND
33
-
SPACE --> SELECT --> DAG --> BACKEND
29
+
PRE --> S1 --> S2 --> S3
30
+
M --> S3
31
+
S3 --> PLAN --> BACKEND
34
32
```
35
33
36
-
`CandidateLogicalASAPDAGs` is the output of logical candidate search. Each target's candidate set holds
37
-
alternatives and rejection reasons, but no materialization decision.
38
-
Choose between two branches: inspect candidates (optionally ranked), or select
39
-
and assemble logical DAGs. Stage 2 materialization (#509) will decide per
40
-
sub-DAG whether to materialize and whether at ingestion or query time; until
41
-
then every summary runs at query time. No branch by itself deploys or executes
42
-
a physical plan.
43
-
Known-invalid evidence rejects a logical candidate. Missing accuracy evidence
44
-
leaves a constructible candidate visible in `CandidateLogicalASAPDAGs` but uncertified; default
45
-
selection does not commit it without the required guarantee. Cost evidence can
46
-
rank eligible candidates, but it cannot establish a missing guarantee or turn
47
-
an unsupported physical alternative into a deployable plan.
34
+
Stage 1 lists alternatives without pricing them. Stage 3 rejects a candidate
35
+
whose summary estimate misses its query's accuracy target (or has no accuracy
36
+
model), that needs a capability the deployment lacks, or that exceeds its
37
+
memory budget, and selects the cheapest remaining one. Rejection reasons are
38
+
reported with the selection. Cost evidence can rank valid candidates, but it
39
+
cannot establish a missing guarantee or turn an unsupported physical
40
+
alternative into a deployable plan.
48
41
49
42
## Module map
50
43
@@ -53,7 +46,7 @@ an unsupported physical alternative into a deployable plan.
53
46
| Shared IR |`asap-types`| The unified operator IR (`ir`: one `OperatorNode` before and after ASAP optimization), schemas, workloads, guarantees, and exported plan data |
54
47
| Front-end common |`frontend-common`| Name-based `UnresolvedOp` tree shared by the front ends, and `resolve_root` into the operator IR |
55
48
| Query frontends |`frontend-sql`, `frontend-promql`, `frontend-metricsql`| Parse source languages and produce canonical Pre-ASAP queries |
Copy file name to clipboardExpand all lines: docs/design_docs/architecture/input-output-workflow.md
+18-7Lines changed: 18 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,17 @@
2
2
3
3
## Overview
4
4
5
+
> **Status:** the candidate-space output and the ranking and selection
6
+
> workflows this document describes (`CandidateLogicalASAPDAGs`, `cost_sorted`,
7
+
> `global_selection`, `CostModel`) were removed with the legacy search (#630,
8
+
> #635). ASAPPlanner now runs the #509 stage pipeline and returns the selected
9
+
> plan: `asap_planner::e2e_plan` returns a `PlanOutput`, and
10
+
> `asap_plan_selection::plan_stages` a `StagePipelineRun` with Stage 1's
11
+
> alternatives and the selection report. See the
12
+
> [library API](../../develop_docs/library-api.md) for the current workflow.
13
+
> The input sections below still describe the current `PlanningWorkload`; the
14
+
> output and workflow sections are kept as a historical record.
15
+
5
16
This document is for library integrators such as ASAPQuery-backend, not users
6
17
submitting queries through a backend.
7
18
@@ -17,7 +28,7 @@ Post-ASAP alternatives for the workload.
17
28
|`PlanningWorkload.query_workload`| Query language and one-time/repeating query workloads | Yes |
18
29
|`PlanningWorkload.data_workload`| Data arrival and optional evidence about ingestion, cardinality, and distribution | No implicit default. Set `None` when unavailable for non-PromQL workloads; PromQL requires `Some(DataWorkload)` with a nonzero ingestion interval. |
19
30
| Frontend-specific dependencies (outside `PlanningWorkload`) |`SqlCatalog` for SQL; `now_ms` and, when needed, `HistogramCatalog` for PromQL |`SqlCatalog` is required for SQL lowering; `now_ms` is required for PromQL lowering |
20
-
| Planning models |Candidate cost/ranking and accuracy composition/checking| Used by the relevant APIs; built-in `DefaultCostModel` and`DefaultAccuracyModel` are available|
31
+
| Planning models |Accuracy checking, cost calibration and deployment capabilities (`PlanningModels`) |`PlanningModels::builtin()` uses`DefaultAccuracyModel`, an illustrative calibration and unrestricted capabilities|
21
32
| External evidence and capabilities | Domain facts, measured costs, workload statistics, and runtime support | Supply when available and when the chosen optimization depends on them; absence is not proof |
22
33
23
34
Frontend lowering and candidate search are stages within this workflow, not
@@ -277,8 +288,8 @@ latter cannot be fabricated by one.
277
288
278
289
| Input | Where it enters / default | Why it matters |
279
290
|---|---|---|
280
-
| Accuracy model |Target-aware search takes an `AccuracyModel`; `DefaultAccuracyModel`is available. Default strategies also use it for candidate construction. |Composes candidate guarantees and checks them against requested accuracy. The model does not itself provide missing data-domain facts. |
281
-
| Cost model|Candidate strategies and `cost_sorted`/`global_selection` use a `CostModel`; `DefaultCostModel` is available. |Ranks or selects candidates. The built-in model is not a measured deployment cost for every physical implementation. |
291
+
| Accuracy model |`PlanningModels.accuracy`; `DefaultAccuracyModel`by default. Stage 3 checks each summary estimate with it. |Derives each estimate's guarantee and checks it against the requested accuracy. The model does not itself provide missing data-domain facts. |
292
+
| Cost calibration|`PlanningModels.calibration`; `Stage3Calibration::ILLUSTRATIVE` by default. |Stage 3 prices candidates analytically; the built-in calibration is not a measured deployment cost. |
282
293
| Accuracy/domain evidence |`AccuracyEvidenceProvider`; default strategies use `NoAccuracyEvidence` when no provider is supplied. | Input ranges, nonempty populations, Top-K intervals, and similar facts can certify or rule out particular approximations. Missing facts remain unknown. |
283
294
| Measured cost evidence | Supplied through a deployment-specific cost model or physical-evidence provider when cost-based physical comparison is needed. | CPU, memory, and I/O estimates must be comparable before claiming a summary beats raw recomputation. |
284
295
| Runtime capabilities | Checked by deployment-specific providers. | Prevents choosing a maintenance/window operation the intended executor cannot implement. |
@@ -297,7 +308,7 @@ the applicable strategy, accuracy target, and helper; missing evidence is not
297
308
a blanket reason to discard unrelated candidates. For the direct DDSketch
298
309
ratio above, search retains a candidate without a proven root guarantee when
299
310
domain evidence is missing; automatic `global_selection` does not choose it.
300
-
See the [candidate-search reference](../../develop_docs/library-api.md#generate-and-rank-candidates)
311
+
See the [candidate-search reference](../../develop_docs/library-api.md)
301
312
for this backend-selection path.
302
313
303
314
---
@@ -414,16 +425,16 @@ the result for one query root.
414
425
|:---:|
415
426
|**Input:**[CandidateLogicalASAPDAGs](asap-aware-plan-search.md) + cost model |
0 commit comments