Repository navigation
docs: end-to-end planning flow from traces to an rqe-optimizer plan - #181
Merged
Merged
Conversation
| python fit_skew.py --data-root /path/to/trace-data # writes results/skew_summary.csv | ||
| ``` | ||
|
|
||
| `results/skew_summary.csv` has one row per (dataset, query_id, kind, weight, |
Contributor
There was a problem hiding this comment.
What's kind, weight, range and how does it relate to data_shape?
Collaborator
Author
There was a problem hiding this comment.
They're skew_summary.csv's key columns, from ASAPQuery asap-tools/dataset-analysis (see its README, "Definitions"):
- kind:
keysorvalues.- A key query (group-by keys: sums, top-k, distinct counts) gets the Zipf fit →
DataShape.zipf_s(θ) anddistinct_keys(K). - A value query (quantiles) gets the power-law tail fit →
DataShape.tail_index(a).
- A key query (group-by keys: sums, top-k, distinct counts) gets the Zipf fit →
- weight (key queries only): what each key's rank-frequency counts.
countis the row count per key;valueis the value sum per key, with negatives clipped.- Use the one that matches how the sketch is fed: once per sample (
count, e.g.topkovercount_over_time) or weighted by the sample value (value, e.g.topkoversum/rate). DataShape.zipf_sdescribes whichever insertion mode the engine uses.
- Use the one that matches how the sketch is fed: once per sample (
- range: the query's lookback (
instant,5m,1h, …), i.e. the RAQE's S. Each row is that query evaluated at every step with that window.
The relation to data_shape: WorkloadFacts.data_shape is keyed by (metric, grouping), not by range. If several RAQEs on one grouping have different ranges, take the worst case over them: smallest θ, largest K, smallest a. That's what the AutoSketch-vs-ASAP runner does per stream. I've added this to the doc.
🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… in the planning flow From review on #181: - skew_summary.csv's kind, weight and range columns, and how ranges map onto data_shape (keyed by grouping: the worst case over its RAQEs' ranges). - A 'Fanning out over machines' section and scripts/merge_study_parts.py, which concatenates per-machine run directories, refusing a point in two parts. - Brought up to date: top-k needs no merge curves (heap m·k, #182), the guarantee fallback is merged (#180), main is through #183. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FhcWJExZcmVqS6r6rEtjis
zzylol
force-pushed
the
docs/e2e-planning-flow
branch
from
October 7, 2026 21:31
4f62c8c to
ca2f276
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Answers Milind's question on Slack: how to run the flow end to end, from inferring parameters on real traces for a query workload to giving them to the rqe-optimizer.
What
docs/e2e_planning_flow.md, linked from the README. It covers:fit_skew.py→skew_summary.csvcolumns →MetricFacts/data_shape;study_saturation.py: the accuracy grid with merge curves, the 1e9 subset,--phase optimizer-cost,--cost-shape, and the directory layoutSaturationCurves::loadexpects;small_problem --milpand ASAPQuery'sasap-optimizer-cli --milp(ASAPQuery#804), including the load-time checks and how accuracy is read;It ends with what isn't automated yet. Commands, flags and paths were checked against main (through #178/#179) and ASAPQuery#804.
Gaps it documents
skew_summary.csv→ facts is manual: no script writesdata_shape,cardinalityorvalue_range.--merge-shards-listvalues are picked by hand from the workload's N and m = S/x.🤖 Generated with Claude Code