minor: multi segment benchmark with counter tracking for msq-task and msq-dart queries #20793
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #20793"
general
weight: 0.35
gianm
Description
Add a multi segment benchmark for MSQ that can run both on the task engine and with Dart. This adds a new baseline benchmark that measures both query runtime as well as counters for segments, rows read, written, etc. I'm going to be introducing a proposed change for time ordered limit efficiencies for scan queries in the near future and these benchmarks serve as some before/after evidence for value. Pushing as an isolated PR for ease of review for both this and the forthcoming improvements.
Data
DartScanBenchmarkon master: 30 one-day time chunks × 4 segments (120 segments × 100,000 rows = 12M rows),clusteringCardinality=100,maxNumTasks=2.below is simplified output in markdown table. With my forthcoming work on time ordered scans with limit, the counters will be clear and obvious areas where the work is reduced for some of these benchmark queries who take the optimized path.
| Query | Layout | Limit | ms/op (± 99.9% CI) | Alloc / query | Segments | Rows in segments | Rows written |
|---|---|---:|---:|---:|---:|---:|---:|
|
orderByTimeDescWithLimit| V9_TIME_ORDERED | 10 | 12.4 ± 9.5 | 17.5 MB | 120 | 12,000,000 | 1,200 || | V9_TIME_ORDERED | 10000 | 296.5 ± 44.0 | 601.4 MB | 120 | 12,000,000 | 1,200,000 |
| | V10_UNCLUSTERED_CLUSTERING_ORDER | 10 | 3,434.7 ± 985.3 | 5,746.6 MB | 120 | 12,000,000 | 12,000,000 |
| | V10_UNCLUSTERED_CLUSTERING_ORDER | 10000 | 3,714.5 ± 411.5 | 5,809.5 MB | 120 | 12,000,000 | 12,000,000 |
| | V10_CLUSTERED | 10 | 495.0 ± 143.9 | 1,594.3 MB | 120 | 12,000,000 | 1,200 |
| | V10_CLUSTERED | 10000 | 1,100.9 ± 197.2 | 2,433.4 MB | 120 | 12,000,000 | 1,200,000 |
|
whereClusterKeyOrderByTimeDescWithLimit| V9_TIME_ORDERED | 10 | 13.1 ± 18.6 | 18.3 MB | 120 | 12,000,000 | 1,200 || | V9_TIME_ORDERED | 10000 | 115.8 ± 61.1 | 91.3 MB | 120 | 12,000,000 | 121,035 |
| | V10_UNCLUSTERED_CLUSTERING_ORDER | 10 | 48.8 ± 33.9 | 76.2 MB | 120 | 12,000,000 | 121,035 |
| | V10_UNCLUSTERED_CLUSTERING_ORDER | 10000 | 53.2 ± 32.0 | 81.6 MB | 120 | 12,000,000 | 121,035 |
| | V10_CLUSTERED | 10 | 18.3 ± 30.7 | 36.0 MB | 120 | 12,000,000 | 1,200 |
| | V10_CLUSTERED | 10000 | 58.8 ± 42.9 | 127.8 MB | 120 | 12,000,000 | 121,035 |
|
whereDimOrderByTimeDescNoLimit| V9_TIME_ORDERED | none | 222.1 ± 95.7 | 413.5 MB | 120 | 12,000,000 | 267,502 || | V9_TIME_ORDERED | none | 232.4 ± 125.5 | 413.6 MB | 120 | 12,000,000 | 267,502 |
| | V10_UNCLUSTERED_CLUSTERING_ORDER | none | 274.2 ± 14.3 | 415.8 MB | 120 | 12,000,000 | 267,502 |
| | V10_UNCLUSTERED_CLUSTERING_ORDER | none | 278.1 ± 61.0 | 415.8 MB | 120 | 12,000,000 | 267,502 |
| | V10_CLUSTERED | none | 831.7 ± 487.8 | 2,292.4 MB | 120 | 12,000,000 | 267,502 |
| | V10_CLUSTERED | none | 771.0 ± 248.4 | 2,296.4 MB | 120 | 12,000,000 | 267,502 |
Queries (
nis thelimitparameter):orderByTimeDescWithLimit:SELECT FROM scan_ds ORDER BY __time DESC LIMIT nwhereClusterKeyOrderByTimeDescWithLimit:SELECT FROM scan_ds WHERE clusterKey1 = '1' ORDER BY __time DESC LIMIT nwhereDimOrderByTimeDescNoLimit:SELECT FROM scan_ds WHERE dimSecondary = '7' ORDER BY __time DESCLayouts (the same three as
SqlClusteredSegmentsBenchmark):V9_TIME_ORDERED: V9 segment sorted by__timefirst.V10_UNCLUSTERED_CLUSTERING_ORDER: V10 segment sorted by clusterKey1, clusterKey2, then__time; not time-ordered.V10_CLUSTERED: V10 clustered base table, one value group per (clusterKey1, clusterKey2), each sorted by__time.Columns:
gc.alloc.rate.norm), in MB (10^6 bytes).whereDimOrderByTimeDescNoLimitignores thelimitparameter, so its two rows per layout run the same query.Release note
N/A
<hr>
##### Key changed/added classes in this PR
all of em
<hr>
<!-- Check the items by putting "x" in the brackets for the done things. Not all of these items apply to every PR. Remove the items which are not done or not relevant to the PR. None of the items from the checklist below are strictly necessary, but it would be very helpful if you at least self-review the PR. -->
This PR has: