Skip to content

[Subtask]: Restrict grouped correlated subqueries to candidate keys before aggregation #30843

Done

Description

@aunjgr

Parent Issue

#30838

Detail of Subtask

Evidence reassessment — 2026-10-26

Current delivery/performance status: DESIGN/VALIDATION OPEN. Strong captured work-volume difference; proposed optimizer transformation remains unvalidated.

Observed: Pinned SF100 Q20 forms 54,543,918 MO intermediate groups after about 91.03M date-filtered rows; DuckDB restricts the corresponding aggregate to 989,835 rows and 593,278 groups. The 91.94x group-count ratio identifies extra work, not a 92x possible query speedup.

Not yet established: The legal and cost-effective candidate-key restriction for the current plan, including correlations, missing groups, duplicates and NULL-sensitive outer expressions.

Next discriminating experiment: Trace candidate keys and the aggregate boundary in current plans. Prove a generic restriction and its rejection cases; report actual aggregate input/groups, state bytes and total CPU before tuning update kernels.

Measured target: Unchanged Q20 with less aggregate work/state and a measured whole-query improvement under the same budget.

Mandatory controls and total cost boundary: Missing/duplicate outer keys, NULL correlations, empty/all-NULL SUM, changed predicates, nonselective candidates, build/filter startup and retained state.

Performance acceptance and rejection

  • Freeze current-main/candidate sources, executables, real caller shapes and effective settings. Use the unchanged qualification SQL and complete result consumption; exclude cold runs and keep profiles separate from latency scoring.
  • Demonstrate the named work/CPU reduction and an attributable uninstrumented target-query improvement. Include the controls below and full Q1-Q22 comparison; component wins, source changes, functional tests, SCA, merging and profile percentages are separate evidence.
  • A confirmed affected/control slowdown fails; unresolved slower signals are inconclusive. Confirm with an independent longer balanced run. No gain elsewhere, favorable average or self-approved tolerance waives a regression.
  • Complete applicable SF10/SF100 and memory/mixed-I/O acceptance before issue closure under the umbrella protocol. Report uncertainty, absolute CPU/instructions/work, allocations/copies and the same whole-application budget, effective cache, I/O/spill/swap/pressure evidence. Benchmark scripts do not verify input/table/schema/row counts/reference results/checksums.

Semantics and lifecycle requirements retained

  • A reviewed optimizer rule states its proof and negation; deterministic tests include missing keys, NULL correlations, duplicate outer keys, empty aggregates and a nonselective negative control.
  • For unchanged Q20 SQL, native plans show candidate-key restriction before the expensive aggregate and materially fewer aggregate inputs/groups.
  • Report warmed CPU, instructions, intermediate state/peak memory and uninstrumented latency at the same host/budget; do not multiply a group-count reduction into a claimed query speedup.
  • Coordinate with the generic runtime-filter task, but demonstrate this aggregate-boundary transformation independently.

Describe implementation you've considered

Use existing decorrelation, exact semijoin/key restriction and safe runtime-filter infrastructure. Compare early restriction with the current aggregate-first plan; retain the cheaper route for unselective candidate sets.

Coordination: Coordinate with #30844 filters and #30847 aggregate costs, while measuring this work-elimination rule independently.

Additional information

Pinned implementation / plan references

Activity

  1. self-assigned this
    on Oct 22, 2026
  2. added
    severity/s0
    on Oct 22, 2026
  3. aunjgr commented on Nov 16, 2026

    @aunjgr
    ContributorAuthor

    Implementation: #32816. This is the current independent domain-restriction comparison against main 8e8708a8d3; results are appended here rather than replacing the issue requirements.

    Conclusion: aggregate membership domain restriction

    Q20 wall changes -74.32%/-75.76%/-34.27%, user instructions
    -64.11%/-63.79%/-45.69%, and Go allocated bytes -71.79%/-69.65%/-63.69% in
    SF10 memory/SF10 disk/SF100 disk. Primary Total wall changes
    -3.94%/-4.52%/-.89%. These gains do not excuse a control regression; original
    slower values remain visible below.

    Investigating the SF100 controls

    Primary Q13/Q16 wall medians were +5.71%/+12.36%. Most slower controls have nearly
    unchanged or lower non-GC instructions, with higher stalled cycles/kernel costs;
    observed effective CPU frequency remains near4.9GHz. Q16's raw instructions fall
    6.01% and its non-GC estimate falls1.83% despite the higher primary elapsed value.

    A separate UNSCORED Q20 -> Q13 -> Q16 history probe brackets this branch with
    identical main binaries, with one excluded cold pass/five warm passes and extra
    TLB/cache counters. Its smaller cache history differs from the all22 qualification;
    none of these samples replaces a primary value.

    Metric Main before Domain restriction Identical main after
    Q20 wall s 2.86768 1.05126 2.81034
    Q13 wall s 3.60064 3.60617 3.60426
    Q16 wall s .75271 .72839 .71774
    Q16 CPU s 13.2370 12.8615 13.1451
    Q16 instructions G 61.066 59.119 61.050
    Q16 DTLB misses/1000 instructions .7955 .7002 .6208

    Q13 is essentially equal; Q16 wall lies between main references, with lower CPU
    and instructions. The probe does not reproduce a stable control penalty from the
    reduced Q20 work. Original source/rule/prefix/ownership logic was retained. No
    sample removal, source rollback, latency threshold change or additional tradeoff
    was used to make this assessment. Exact historical stall attribution remains
    limited; these measurements are not a formal noninferiority proof or completion
    of the broader umbrella's acceptance.

    Measurement scope

    Fresh current main 8e8708a8d306a69512d140b40bfcfebc1d404a32, which includes the
    file-service revert, is the reference. Every arm is isolated; no pending allocator
    or other optimization PR is included. Go1.27.1, SIMD/v3, function alignment64 and
    matching native artifacts/release metadata are used. THP stays enabled with its
    existing host policy; no VM policy or preconditioning is added.

    One process per arm/configuration, one excluded cold Q1–Q22 suite followed by five
    profiled warm full suites. All32 CPUs, 48GiB application/aggregate/join thresholds,
    16GiB shared cache. Spill/swap/OOM and compiler/excess external-CPU interference
    invalidate a capture. Two compact SF100 attempts overlapped Cargo and are retained
    wholly excluded; no partial sample was pooled. The automated quiet resume reused
    completed configurations. Benchmark SQL is executed/drained without checking
    input/table/schema/row/reference-result/checksum contents.

    Primary timings include GC and instrumentation. Total sums per-query medians;
    no GC-subtracted wall time or independent-process confidence bound is claimed.
    Native per-query counters publish asynchronously; the tables preserve their
    limits. No globally exact copy-byte counter exists. Single-host/process evidence
    cannot establish every-workload or population noninferiority.

    Exact service pins

    Arm Source ELF SHA-256
    main 8e8708a8d306a69512d140b40bfcfebc1d404a32 e50cd32c7844c2074d56aabbd8c20c07f32627d294286668dd1e231a89b63b06
    membership-restriction 7181ef4d29aaf50fbf116169187dd98f1e13a476 b8d2e1b8ce96ccc3933d548c398e952b230edb2700fb8174aeaf56346ae04e04
    compact 19ca2f1d0a8fc802cc331b8f7da3f382177bff73 9e338eb777e288702e269d20b1e4543a4043113a3a6bf4bf71de120f937e4002
    sf10-memory: all 22 queries, Total, CPU, instructions and allocations
    Query Main wall s Candidate wall s Wall Δ Main CPU s Candidate CPU s Main instructions G Candidate instructions G Instructions Δ
    1 0.209173 0.210820 +0.79% 5.99594 6.10710 66.7678 66.7621 -0.01%
    2 0.029844 0.030558 +2.39% 0.42656 0.38265 2.5821 2.5673 -0.57%
    3 0.121167 0.120221 -0.78% 2.72487 2.83902 8.9581 8.9641 +0.07%
    4 0.064635 0.065317 +1.06% 1.56855 1.54567 10.6516 10.6516 +0.00%
    5 0.094294 0.087702 -6.99% 2.09203 1.87547 10.1923 8.9139 -12.54%
    6 0.036614 0.035655 -2.62% 0.77325 0.85780 3.8922 3.8912 -0.03%
    7 0.090074 0.092518 +2.71% 2.19213 2.20912 7.7082 7.9532 +3.18%
    8 0.248712 0.250672 +0.79% 2.38467 2.31824 12.9967 13.3182 +2.47%
    9 0.259862 0.259295 -0.22% 5.83832 5.74833 37.6109 36.3821 -3.27%
    10 0.224892 0.228752 +1.72% 5.50040 5.50911 24.8560 24.8492 -0.03%
    11 0.031620 0.033758 +6.76% 0.44541 0.45517 2.9058 2.9016 -0.15%
    12 0.085813 0.088959 +3.67% 2.13188 2.41186 12.4890 13.7377 +10.00%
    13 0.253139 0.256088 +1.16% 6.81977 6.83904 44.3135 44.2316 -0.18%
    14 0.079365 0.081804 +3.07% 1.16725 1.13867 7.8631 7.3616 -6.38%
    15 0.169590 0.165050 -2.68% 1.82851 1.78453 11.0258 11.0324 +0.06%
    16 0.140549 0.142396 +1.31% 1.66378 1.73343 7.8620 7.6651 -2.50%
    17 0.083983 0.078090 -7.02% 2.06083 1.82526 15.2211 14.0952 -7.40%
    18 0.365285 0.387974 +6.21% 7.05983 7.46858 21.6987 21.8674 +0.78%
    19 0.124486 0.121170 -2.66% 3.22636 3.19504 21.7665 21.7675 +0.00%
    20 0.218104 0.056018 -74.32% 4.62256 1.24160 18.0422 6.4758 -64.11%
    21 0.318295 0.326861 +2.69% 8.22978 8.51360 68.8936 70.1792 +1.87%
    22 0.046138 0.045957 -0.39% 0.80188 0.77820 6.8960 6.8921 -0.06%
    Total 3.295635 3.165635 -3.94% 69.55457 66.77749 425.1932 412.4598 -2.99%

    Allocation counters include common process/scrape and asynchronous engine work. No globally exact copy-byte counter is available. GC CPU is measured process GC CPU, not a wall-time subtraction.

    | Query | Main Go MB | Candidate Go MB | Go bytes Δ | Main Go objects | Candidate Go objects | Main GC CPU s | Candidate GC CPU s |
    |---|---:|---:|---:|---:|---:|---:|---:|---:|
    | 1 | 53.084 | 52.426 | -1.24% | 380858 | 383840 | 0.0000 | 0.0000 |
    | 2 | 35.001 | 23.692 | -32.31% | 355925 | 316190 | 0.0000 | 0.0000 |
    | 3 | 37.245 | 45.837 | +23.07% | 454717 | 489777 | 0.0000 | 0.0000 |
    | 4 | 38.364 | 38.513 | +0.39% | 332364 | 337706 | 0.0000 | 0.0000 |
    | 5 | 62.934 | 50.264 | -20.13% | 467834 | 419145 | 0.2210 | 0.0000 |
    | 6 | 38.499 | 38.685 | +0.48% | 240494 | 267024 | 0.0000 | 0.0000 |
    | 7 | 53.243 | 66.780 | +25.43% | 409656 | 416960 | 0.0000 | 0.2009 |
    | 8 | 284.415 | 281.534 | -1.01% | 2416905 | 2399928 | 0.2974 | 0.2680 |
    | 9 | 153.107 | 150.653 | -1.60% | 2454638 | 2445882 | 0.1918 | 0.0000 |
    | 10 | 60.399 | 59.847 | -0.91% | 797448 | 780313 | 0.0000 | 0.0000 |
    | 11 | 31.715 | 31.832 | +0.37% | 538175 | 544188 | 0.0000 | 0.0000 |
    | 12 | 51.046 | 62.261 | +21.97% | 387770 | 419785 | 0.0000 | 0.2236 |
    | 13 | 866.696 | 860.574 | -0.71% | 15293140 | 15271759 | 0.7167 | 0.6033 |
    | 14 | 47.718 | 29.219 | -38.77% | 1009411 | 271347 | 0.0000 | 0.0000 |
    | 15 | 57.032 | 54.701 | -4.09% | 670423 | 630011 | 0.0000 | 0.0000 |
    | 16 | 39.455 | 32.126 | -18.58% | 652012 | 354498 | 0.0000 | 0.0000 |
    | 17 | 78.841 | 64.714 | -17.92% | 537313 | 480254 | 0.2146 | 0.0000 |
    | 18 | 43.579 | 52.677 | +20.88% | 372414 | 441253 | 0.0000 | 0.0000 |
    | 19 | 72.620 | 72.317 | -0.42% | 590994 | 613929 | 0.0000 | 0.0000 |
    | 20 | 129.643 | 36.574 | -71.79% | 2378804 | 342153 | 0.2127 | 0.0000 |
    | 21 | 93.914 | 110.180 | +17.32% | 650130 | 692684 | 0.0000 | 0.2092 |
    | 22 | 23.775 | 21.770 | -8.43% | 254990 | 239341 | 0.0000 | 0.0000 |
    | Total | 2352.326 | 2237.176 | -4.90% | 31646415 | 28557967 | 1.8542 | 1.5049 |

    Native allocation attribution limit: the default allocator publishes counters after a 100 ms window; MPool publishes after a one-second window. Their query-boundary increments are retained in raw JSON, but can belong to neighboring queries. They are not exact per-query allocation evidence and are not used to declare a per-query allocation pass. IO/cache counters overlap the default allocator and must not be added again. Long-window native totals also have endpoint lag; exact per-query native costs need separate operator/component evidence.

    Query Main system CPU s Candidate system CPU s Main minor faults Candidate minor faults Main read MB Candidate read MB Main host THP fallbacks Candidate host THP fallbacks
    1 0.0000 0.0000 4105 4081 0.00 0.00 0 0
    2 0.0116 0.0175 1139 1981 0.00 0.00 0 0
    3 0.0249 0.0253 8729 7332 0.00 0.00 1 0
    4 0.0105 0.0147 425 267 0.00 0.00 0 0
    5 0.0330 0.0444 1973 4293 0.00 0.00 0 0
    6 0.0000 0.0000 3 1 0.00 0.00 0 0
    7 0.0291 0.0283 4564 2046 0.00 0.00 0 0
    8 0.0507 0.0574 26905 32722 0.00 0.00 39 25
    9 0.1486 0.1884 51489 51902 0.00 0.00 24 32
    10 0.1839 0.1915 34701 36773 0.00 0.00 2 0
    11 0.0132 0.0166 2941 3268 0.00 0.00 0 0
    12 0.0330 0.0318 2857 3093 0.00 0.00 0 0
    13 0.1320 0.0921 26278 18860 0.00 0.00 7 8
    14 0.0207 0.0399 2385 3580 0.00 0.00 0 0
    15 0.0392 0.0356 728 365 0.00 0.00 0 0
    16 0.0780 0.0822 13349 11683 0.00 0.00 0 0
    17 0.0000 0.0000 40 6 0.00 0.00 0 0
    18 2.2624 2.5793 193071 201873 0.00 0.00 143 115
    19 0.0000 0.0000 266 462 0.00 0.00 0 0
    20 0.4200 0.0105 43252 710 0.00 0.00 4 0
    21 0.0020 0.0171 2604 5369 0.00 0.00 0 0
    22 0.0272 0.0148 5140 237 0.00 0.00 0 0
    Total 3.5201 3.4875 426944 390904 0.00 0.00 220 180

    Faults/system CPU/read bytes belong to the measured application. THP fallback counts are host-wide supporting evidence; they neither automatically invalidate a result nor excuse an introduced resource regression.
    Whole-warm peak GiB: main 20.843, candidate 20.935.

    External process cores: main 0.442, candidate 0.488; interrupt cores separately: 0.355, 0.342.

    GC attribution uses period-weighted instruction samples; non-GC figures are estimates, not exact foreground counters. Raw hardware instructions are above.

    Query Main estimated non-GC instructions G Candidate estimated non-GC instructions G Δ
    1 66.7678 66.7601 -0.01%
    2 2.5821 2.5673 -0.57%
    3 8.9581 8.9641 +0.07%
    4 10.6516 10.6516 +0.00%
    5 8.9637 8.9139 -0.56%
    6 3.8922 3.8912 -0.03%
    7 7.7082 7.7152 +0.09%
    8 11.9075 11.7855 -1.03%
    9 36.2913 36.3655 +0.20%
    10 24.8560 24.8492 -0.03%
    11 2.9058 2.9016 -0.15%
    12 12.4890 12.4944 +0.04%
    13 38.9909 39.6193 +1.61%
    14 7.8578 7.3520 -6.44%
    15 11.0215 11.0320 +0.10%
    16 7.8620 7.6651 -2.50%
    17 13.9833 14.0910 +0.77%
    18 21.6987 21.6914 -0.03%
    19 21.7665 21.7662 -0.00%
    20 16.4975 6.4758 -60.75%
    21 68.8936 69.1150 +0.32%
    22 6.8960 6.8921 -0.06%
    Total 413.4411 403.5594 -2.39%
    sf10-disk: all 22 queries, Total, CPU, instructions and allocations
    Query Main wall s Candidate wall s Wall Δ Main CPU s Candidate CPU s Main instructions G Candidate instructions G Instructions Δ
    1 0.218540 0.211103 -3.40% 6.04298 6.02618 66.7652 66.7691 +0.01%
    2 0.030740 0.029564 -3.83% 0.37691 0.40079 2.5769 2.5703 -0.26%
    3 0.119129 0.122458 +2.79% 2.69380 2.94003 8.9551 10.0383 +12.10%
    4 0.063042 0.066476 +5.45% 1.54499 1.55403 10.6539 10.6594 +0.05%
    5 0.088038 0.091800 +4.27% 1.85091 1.92637 8.9196 8.8790 -0.46%
    6 0.036913 0.032414 -12.19% 0.86933 0.80124 3.8962 3.8904 -0.15%
    7 0.091905 0.092317 +0.45% 2.18039 2.22396 7.7077 7.7176 +0.13%
    8 0.243284 0.240937 -0.96% 2.37176 2.17772 13.1589 11.7418 -10.77%
    9 0.251727 0.257851 +2.43% 5.71262 5.63353 36.3776 36.3427 -0.10%
    10 0.224216 0.229906 +2.54% 5.36496 5.52800 24.8736 24.8274 -0.19%
    11 0.032660 0.033206 +1.67% 0.46874 0.47145 2.9029 2.9010 -0.07%
    12 0.086806 0.081844 -5.72% 2.06807 2.07810 12.4929 12.4911 -0.01%
    13 0.249260 0.245564 -1.48% 6.70478 6.68593 43.9554 44.1777 +0.51%
    14 0.081055 0.075995 -6.24% 1.12237 1.05095 7.8785 7.3606 -6.57%
    15 0.163831 0.168533 +2.87% 1.78109 1.76982 11.1472 11.0321 -1.03%
    16 0.137598 0.138070 +0.34% 1.67359 1.71325 7.8600 7.6631 -2.50%
    17 0.080660 0.080300 -0.45% 2.07271 2.06159 15.2194 15.4027 +1.20%
    18 0.375695 0.389905 +3.78% 7.27437 7.21084 21.9097 21.6788 -1.05%
    19 0.117847 0.118872 +0.87% 3.08520 3.17284 21.7638 21.7616 -0.01%
    20 0.228088 0.055284 -75.76% 4.61630 1.19703 17.8979 6.4805 -63.79%
    21 0.322707 0.333855 +3.45% 8.31072 8.62952 68.9354 70.3303 +2.02%
    22 0.044162 0.043123 -2.35% 0.80125 0.78978 6.8955 6.8941 -0.02%
    Total 3.287905 3.139378 -4.52% 68.98785 66.04295 422.7433 411.6095 -2.63%

    Allocation counters include common process/scrape and asynchronous engine work. No globally exact copy-byte counter is available. GC CPU is measured process GC CPU, not a wall-time subtraction.

    | Query | Main Go MB | Candidate Go MB | Go bytes Δ | Main Go objects | Candidate Go objects | Main GC CPU s | Candidate GC CPU s |
    |---|---:|---:|---:|---:|---:|---:|---:|---:|
    | 1 | 53.311 | 52.939 | -0.70% | 389193 | 389075 | 0.0000 | 0.0000 |
    | 2 | 24.387 | 24.054 | -1.36% | 324302 | 330124 | 0.0000 | 0.0000 |
    | 3 | 37.416 | 52.539 | +40.42% | 443405 | 489881 | 0.0000 | 0.2459 |
    | 4 | 38.177 | 37.274 | -2.37% | 332261 | 309540 | 0.0000 | 0.0000 |
    | 5 | 50.013 | 51.354 | +2.68% | 423472 | 427749 | 0.0000 | 0.0000 |
    | 6 | 52.622 | 39.714 | -24.53% | 296198 | 274358 | 0.2004 | 0.0000 |
    | 7 | 52.395 | 53.302 | +1.73% | 402642 | 409253 | 0.0000 | 0.0000 |
    | 8 | 285.416 | 282.055 | -1.18% | 2417426 | 2373669 | 0.2990 | 0.2683 |
    | 9 | 152.431 | 150.428 | -1.31% | 2448441 | 2468353 | 0.0000 | 0.0000 |
    | 10 | 62.458 | 58.115 | -6.95% | 778893 | 759864 | 0.0000 | 0.0000 |
    | 11 | 31.075 | 31.432 | +1.15% | 525749 | 536695 | 0.0000 | 0.0000 |
    | 12 | 49.327 | 50.515 | +2.41% | 380860 | 384395 | 0.0000 | 0.0000 |
    | 13 | 864.229 | 862.729 | -0.17% | 15307493 | 15298938 | 0.6292 | 0.6399 |
    | 14 | 49.433 | 30.523 | -38.25% | 1035634 | 268127 | 0.0000 | 0.0000 |
    | 15 | 64.901 | 55.129 | -15.06% | 722255 | 663369 | 0.0000 | 0.0000 |
    | 16 | 39.459 | 33.779 | -14.40% | 668359 | 380408 | 0.0000 | 0.0000 |
    | 17 | 79.946 | 79.744 | -0.25% | 519175 | 541089 | 0.2093 | 0.2040 |
    | 18 | 53.700 | 43.529 | -18.94% | 413435 | 372823 | 0.0000 | 0.0000 |
    | 19 | 71.321 | 69.947 | -1.93% | 583507 | 568904 | 0.0000 | 0.0000 |
    | 20 | 126.967 | 38.531 | -69.65% | 2358312 | 372269 | 0.1890 | 0.0000 |
    | 21 | 95.359 | 111.241 | +16.65% | 673108 | 697999 | 0.0000 | 0.2109 |
    | 22 | 21.597 | 20.401 | -5.54% | 231100 | 211302 | 0.0000 | 0.0000 |
    | Total | 2355.943 | 2229.273 | -5.38% | 31675220 | 28528184 | 1.5269 | 1.5690 |

    Native allocation attribution limit: the default allocator publishes counters after a 100 ms window; MPool publishes after a one-second window. Their query-boundary increments are retained in raw JSON, but can belong to neighboring queries. They are not exact per-query allocation evidence and are not used to declare a per-query allocation pass. IO/cache counters overlap the default allocator and must not be added again. Long-window native totals also have endpoint lag; exact per-query native costs need separate operator/component evidence.

    Query Main system CPU s Candidate system CPU s Main minor faults Candidate minor faults Main read MB Candidate read MB Main host THP fallbacks Candidate host THP fallbacks
    1 0.0000 0.0000 1660 5421 0.00 0.00 0 0
    2 0.0130 0.0128 440 1627 0.00 0.00 0 0
    3 0.0301 0.0347 8869 6482 0.00 0.00 0 1
    4 0.0119 0.0105 262 272 0.00 0.00 0 0
    5 0.0334 0.0259 1560 2213 0.00 0.00 0 0
    6 0.0000 0.0000 3 2 0.00 0.00 0 0
    7 0.0329 0.0199 11929 1159 0.00 0.00 0 0
    8 0.0618 0.0572 22523 28797 0.00 0.00 23 26
    9 0.1452 0.1416 43839 41791 0.00 0.00 21 32
    10 0.1895 0.1818 29561 26368 0.00 0.00 0 3
    11 0.0176 0.0147 2265 2414 0.00 0.00 0 1
    12 0.0151 0.0104 1485 1634 0.00 0.00 0 0
    13 0.1012 0.0871 38776 19165 0.00 0.00 14 10
    14 0.0196 0.0282 1344 3597 0.00 0.00 0 0
    15 0.0396 0.0368 1110 472 0.00 0.00 0 0
    16 0.0660 0.0791 8662 13000 0.00 0.00 0 0
    17 0.0043 0.0000 613 9 0.00 0.00 0 0
    18 2.3066 2.4039 187132 201751 0.00 0.00 127 126
    19 0.0000 0.0000 108 521 0.00 0.00 0 0
    20 0.4362 0.0048 41710 624 0.00 0.00 0 0
    21 0.0000 0.0071 1408 7213 0.00 0.00 0 0
    22 0.0229 0.0146 6565 267 0.00 0.00 0 0
    Total 3.5469 3.1712 411824 364799 0.00 0.00 185 199

    Faults/system CPU/read bytes belong to the measured application. THP fallback counts are host-wide supporting evidence; they neither automatically invalidate a result nor excuse an introduced resource regression.
    Whole-warm peak GiB: main 15.510, candidate 15.347.

    External process cores: main 0.425, candidate 0.505; interrupt cores separately: 0.351, 0.330.

    GC attribution uses period-weighted instruction samples; non-GC figures are estimates, not exact foreground counters. Raw hardware instructions are above.

    Query Main estimated non-GC instructions G Candidate estimated non-GC instructions G Δ
    1 66.7652 66.7691 +0.01%
    2 2.5769 2.5682 -0.34%
    3 8.9551 8.9627 +0.08%
    4 10.6539 10.6594 +0.05%
    5 8.9196 8.8790 -0.46%
    6 3.8962 3.8904 -0.15%
    7 7.7077 7.7176 +0.13%
    8 11.8645 11.7358 -1.08%
    9 36.3473 36.3325 -0.04%
    10 24.8736 24.8274 -0.19%
    11 2.9029 2.9010 -0.07%
    12 12.4929 12.4878 -0.04%
    13 39.4416 40.2812 +2.13%
    14 7.8785 7.3606 -6.57%
    15 11.0229 11.0321 +0.08%
    16 7.8541 7.6631 -2.43%
    17 14.0875 14.1683 +0.57%
    18 21.7165 21.6788 -0.17%
    19 21.7638 21.7616 -0.01%
    20 16.8233 6.4797 -61.48%
    21 68.9227 69.0446 +0.18%
    22 6.8955 6.8941 -0.02%
    Total 414.3622 404.0950 -2.48%
    sf100-disk: all 22 queries, Total, CPU, instructions and allocations
    Query Main wall s Candidate wall s Wall Δ Main CPU s Candidate CPU s Main instructions G Candidate instructions G Instructions Δ
    1 6.429197 6.329380 -1.55% 106.05117 107.60060 1032.5389 1030.8419 -0.16%
    2 0.537216 0.515582 -4.03% 7.04148 6.45140 35.7952 36.1541 +1.00%
    3 3.543187 3.729481 +5.26% 51.23498 54.28504 201.8452 201.6358 -0.10%
    4 3.131020 3.155901 +0.79% 43.06540 42.88328 219.4884 219.7534 +0.12%
    5 3.877595 3.899197 +0.56% 50.89961 51.98457 184.1805 184.7715 +0.32%
    6 2.175561 2.170843 -0.22% 19.11100 18.73669 115.5927 113.8017 -1.55%
    7 3.902054 3.942331 +1.03% 45.36278 47.64180 176.8818 176.6248 -0.15%
    8 4.221134 4.244947 +0.56% 44.67969 46.79755 203.6142 203.8425 +0.11%
    9 6.866016 7.094290 +3.32% 108.91156 116.47169 522.9803 516.2778 -1.28%
    10 5.363589 5.558057 +3.63% 86.94564 92.29717 478.7717 478.1808 -0.12%
    11 0.589647 0.605310 +2.66% 5.98928 6.64548 34.1257 36.0047 +5.51%
    12 4.469131 4.459739 -0.21% 55.24072 56.41359 368.4404 367.6716 -0.21%
    13 3.765488 3.980638 +5.71% 97.15250 104.66386 497.9427 499.0847 +0.23%
    14 2.644486 2.643276 -0.05% 26.16993 26.24479 134.4547 129.3601 -3.79%
    15 5.074661 5.056559 -0.36% 50.98849 50.65592 228.0561 228.4541 +0.17%
    16 0.727011 0.816864 +12.36% 13.18876 13.90358 63.4685 59.6571 -6.01%
    17 3.697120 3.743298 +1.25% 35.84909 37.42804 222.0915 224.1338 +0.92%
    18 6.549581 6.508773 -0.62% 105.42149 106.21141 373.0007 373.0156 +0.00%
    19 5.328880 5.111718 -4.08% 67.94379 71.36489 572.8889 573.1942 +0.05%
    20 4.366318 2.869952 -34.27% 60.43099 26.51330 222.8346 121.0279 -45.69%
    21 9.918401 9.936427 +0.18% 137.55641 141.55219 906.9187 906.7281 -0.02%
    22 0.544601 0.566048 +3.94% 10.90255 11.53018 73.1930 73.2564 +0.09%
    Total 87.721895 86.938612 -0.89% 1230.13732 1238.27701 6869.1044 6753.4725 -1.68%

    Allocation counters include common process/scrape and asynchronous engine work. No globally exact copy-byte counter is available. GC CPU is measured process GC CPU, not a wall-time subtraction.

    | Query | Main Go MB | Candidate Go MB | Go bytes Δ | Main Go objects | Candidate Go objects | Main GC CPU s | Candidate GC CPU s |
    |---|---:|---:|---:|---:|---:|---:|---:|---:|
    | 1 | 809.919 | 801.577 | -1.03% | 7673573 | 7605946 | 0.5375 | 0.5199 |
    | 2 | 164.058 | 162.303 | -1.07% | 2070665 | 2086170 | 0.0000 | 0.0000 |
    | 3 | 546.566 | 557.228 | +1.95% | 6702849 | 6724274 | 0.4762 | 0.4938 |
    | 4 | 530.791 | 538.026 | +1.36% | 5130311 | 5116286 | 0.0000 | 0.0000 |
    | 5 | 608.633 | 618.055 | +1.55% | 5818255 | 5780954 | 0.5865 | 0.5401 |
    | 6 | 507.050 | 501.862 | -1.02% | 3953776 | 3928590 | 0.4489 | 0.0000 |
    | 7 | 707.831 | 717.480 | +1.36% | 6514005 | 6447654 | 0.4764 | 0.5350 |
    | 8 | 1056.896 | 1061.825 | +0.47% | 9440382 | 9459845 | 0.5503 | 0.5228 |
    | 9 | 1703.960 | 1709.409 | +0.32% | 27772588 | 27769863 | 1.0240 | 1.2240 |
    | 10 | 737.047 | 748.162 | +1.51% | 9741861 | 9795221 | 0.5024 | 0.4672 |
    | 11 | 241.171 | 259.152 | +7.46% | 4168351 | 4264025 | 0.0000 | 0.4597 |
    | 12 | 727.800 | 712.612 | -2.09% | 7098115 | 6984532 | 0.0000 | 0.0000 |
    | 13 | 8467.333 | 8469.841 | +0.03% | 151563814 | 151567922 | 4.6997 | 5.2773 |
    | 14 | 579.029 | 403.708 | -30.28% | 11716821 | 4213896 | 0.0000 | 0.0000 |
    | 15 | 838.320 | 848.832 | +1.25% | 10306200 | 10277556 | 0.4717 | 0.5102 |
    | 16 | 227.157 | 147.815 | -34.93% | 4784878 | 1681607 | 0.0000 | 0.0000 |
    | 17 | 834.765 | 846.233 | +1.37% | 7668068 | 7641241 | 0.4539 | 0.5123 |
    | 18 | 824.520 | 833.672 | +1.11% | 7451487 | 7460166 | 0.5066 | 0.5360 |
    | 19 | 937.666 | 938.452 | +0.08% | 8925475 | 8888752 | 0.4812 | 0.6225 |
    | 20 | 1303.275 | 473.225 | -63.69% | 25109687 | 5009155 | 0.4982 | 0.0000 |
    | 21 | 1475.196 | 1484.638 | +0.64% | 13988428 | 13992683 | 0.5382 | 0.5780 |
    | 22 | 79.478 | 79.086 | -0.49% | 798771 | 785795 | 0.0000 | 0.0000 |
    | Total | 23908.459 | 22913.192 | -4.16% | 338398360 | 307482133 | 12.2516 | 12.7987 |

    Native allocation attribution limit: the default allocator publishes counters after a 100 ms window; MPool publishes after a one-second window. Their query-boundary increments are retained in raw JSON, but can belong to neighboring queries. They are not exact per-query allocation evidence and are not used to declare a per-query allocation pass. IO/cache counters overlap the default allocator and must not be added again. Long-window native totals also have endpoint lag; exact per-query native costs need separate operator/component evidence.

    Query Main system CPU s Candidate system CPU s Main minor faults Candidate minor faults Main read MB Candidate read MB Main host THP fallbacks Candidate host THP fallbacks
    1 12.4965 12.3152 64600 63065 9534.46 9522.55 0 0
    2 1.1708 1.1588 44126 44088 955.52 1020.77 0 0
    3 7.7599 7.6706 76258 75230 8854.79 8818.89 0 0
    4 6.0579 5.9829 42936 38351 7563.53 7534.43 0 0
    5 7.4829 7.2992 38297 39989 9839.58 9807.87 0 0
    6 4.6638 4.5981 2954 4632 6107.94 6097.20 0 0
    7 9.0019 8.9403 138050 126474 10763.35 10725.74 0 0
    8 9.0649 9.3612 105928 102360 11581.03 11535.82 0 0
    9 17.8467 18.7342 858412 817404 13654.41 13157.71 670 763
    10 11.4529 12.1484 659383 742370 10021.13 9984.54 90 56
    11 1.0268 1.1149 18212 17858 1112.08 1164.19 0 0
    12 8.9115 8.9252 32867 27536 10679.65 10651.40 0 0
    13 6.6232 8.5395 525281 675429 4830.02 4780.36 45 545
    14 5.5332 5.4853 61141 59302 6955.59 6945.62 0 3
    15 11.4536 11.4881 129781 127629 13535.32 13533.33 0 0
    16 1.7502 2.6890 269760 319948 328.99 340.31 102 208
    17 7.5570 7.5772 11426 14706 9423.21 9438.04 0 0
    18 35.5009 34.9884 2429586 2427951 9682.92 9595.51 1840 1752
    19 9.8895 10.1352 52126 45448 11303.93 11315.04 0 0
    20 16.2761 7.5902 807203 160906 8184.27 8229.11 290 0
    21 21.0682 20.9214 373313 331063 23926.95 23924.66 0 0
    22 0.6211 0.6633 33064 41591 535.44 534.59 0 0
    Total 213.2093 208.3267 6774704 6303330 189374.13 188657.70 3037 3327

    Faults/system CPU/read bytes belong to the measured application. THP fallback counts are host-wide supporting evidence; they neither automatically invalidate a result nor excuse an introduced resource regression.
    Whole-warm peak GiB: main 31.195, candidate 31.098.

    External process cores: main 0.791, candidate 0.342; interrupt cores separately: 0.627, 0.610.

    GC attribution uses period-weighted instruction samples; non-GC figures are estimates, not exact foreground counters. Raw hardware instructions are above.

    Query Main estimated non-GC instructions G Candidate estimated non-GC instructions G Δ
    1 1030.1403 1028.9571 -0.11%
    2 35.7952 36.1541 +1.00%
    3 200.1820 200.3788 +0.10%
    4 219.4884 219.2292 -0.12%
    5 182.8504 183.1598 +0.17%
    6 113.7050 113.5558 -0.13%
    7 175.5092 175.4880 -0.01%
    8 201.6742 201.7929 +0.06%
    9 519.5595 512.3748 -1.38%
    10 476.6856 477.0058 +0.07%
    11 34.0550 33.7608 -0.86%
    12 368.2290 367.6716 -0.15%
    13 470.1990 471.3177 +0.24%
    14 134.2679 129.3601 -3.66%
    15 226.5756 226.6564 +0.04%
    16 60.7690 59.6571 -1.83%
    17 221.2616 222.1057 +0.38%
    18 370.8343 370.9072 +0.02%
    19 570.7627 571.0413 +0.05%
    20 220.0506 121.0279 -45.00%
    21 904.4923 904.2480 -0.03%
    22 73.1930 73.2086 +0.02%
    Total 6810.2798 6699.0587 -1.63%
    All five primary warm wall times for every query

    sf10-memory

    Query Main suites1–5 wall s Candidate suites1–5 wall s
    1 0.20698, 0.21342, 0.20917, 0.21375, 0.20652 0.20315, 0.22987, 0.21789, 0.20851, 0.21082
    2 0.04017, 0.02978, 0.02984, 0.02826, 0.03102 0.03056, 0.02862, 0.03034, 0.03076, 0.03171
    3 0.12117, 0.11451, 0.12716, 0.11232, 0.12363 0.12620, 0.11524, 0.12022, 0.11200, 0.12548
    4 0.06835, 0.06420, 0.06541, 0.06464, 0.06074 0.06664, 0.06049, 0.06386, 0.06591, 0.06532
    5 0.08564, 0.10205, 0.09030, 0.10003, 0.09429 0.08550, 0.09122, 0.09294, 0.08770, 0.08549
    6 0.03714, 0.03800, 0.03492, 0.03514, 0.03661 0.03531, 0.03394, 0.03749, 0.03565, 0.03578
    7 0.09731, 0.08887, 0.09279, 0.08959, 0.09007 0.10106, 0.08916, 0.08862, 0.09252, 0.10103
    8 0.23840, 0.25903, 0.24871, 0.25166, 0.22604 0.25067, 0.24201, 0.25397, 0.23880, 0.25437
    9 0.26009, 0.25986, 0.26380, 0.25832, 0.25471 0.25204, 0.26513, 0.26136, 0.25073, 0.25930
    10 0.23281, 0.22695, 0.22489, 0.22381, 0.22052 0.22875, 0.23471, 0.22954, 0.22665, 0.22645
    11 0.03847, 0.03162, 0.03120, 0.03258, 0.03150 0.03376, 0.03337, 0.03391, 0.03225, 0.03377
    12 0.08581, 0.08486, 0.09804, 0.08396, 0.08711 0.08440, 0.08865, 0.08896, 0.09996, 0.09298
    13 0.25493, 0.25314, 0.24612, 0.25839, 0.24402 0.25720, 0.25609, 0.25712, 0.25296, 0.24263
    14 0.08626, 0.07871, 0.08548, 0.07937, 0.07881 0.08180, 0.07983, 0.08876, 0.08986, 0.07889
    15 0.17143, 0.16906, 0.16325, 0.17224, 0.16959 0.16983, 0.16505, 0.16306, 0.16544, 0.16295
    16 0.14016, 0.14055, 0.14068, 0.13971, 0.14145 0.13975, 0.15015, 0.14240, 0.14520, 0.13864
    17 0.07626, 0.08398, 0.08999, 0.07091, 0.08580 0.07479, 0.07921, 0.08387, 0.07809, 0.07756
    18 0.37476, 0.36529, 0.36381, 0.36759, 0.36022 0.38894, 0.37883, 0.37885, 0.39390, 0.38797
    19 0.11760, 0.12115, 0.12658, 0.12449, 0.12844 0.11627, 0.13233, 0.12117, 0.12464, 0.11997
    20 0.21050, 0.22445, 0.22417, 0.20728, 0.21810 0.05397, 0.06000, 0.05813, 0.05467, 0.05602
    21 0.31568, 0.31829, 0.32393, 0.31293, 0.32995 0.32655, 0.32297, 0.33119, 0.33108, 0.32686
    22 0.04614, 0.04374, 0.04527, 0.04686, 0.04758 0.04664, 0.04729, 0.04596, 0.04536, 0.04341

    sf10-disk

    Query Main suites1–5 wall s Candidate suites1–5 wall s
    1 0.21854, 0.20313, 0.22805, 0.22043, 0.21348 0.22329, 0.21110, 0.20307, 0.20872, 0.21780
    2 0.03101, 0.03074, 0.02823, 0.03105, 0.02762 0.03081, 0.02956, 0.02945, 0.02891, 0.03360
    3 0.12235, 0.11971, 0.11913, 0.11563, 0.11546 0.12182, 0.13015, 0.12227, 0.12319, 0.12246
    4 0.06781, 0.05851, 0.06138, 0.06484, 0.06304 0.06648, 0.06457, 0.06915, 0.06712, 0.06378
    5 0.08523, 0.08992, 0.08804, 0.08730, 0.08886 0.08970, 0.09789, 0.09653, 0.09180, 0.09089
    6 0.03691, 0.04642, 0.03808, 0.03444, 0.03114 0.03939, 0.03241, 0.03831, 0.03155, 0.03131
    7 0.09264, 0.08762, 0.09190, 0.08954, 0.09250 0.08949, 0.10233, 0.09232, 0.09732, 0.09123
    8 0.23998, 0.22605, 0.25292, 0.24580, 0.24328 0.25863, 0.24448, 0.22921, 0.22699, 0.24094
    9 0.25010, 0.25173, 0.26906, 0.25138, 0.26167 0.26454, 0.25785, 0.26831, 0.25176, 0.25501
    10 0.23076, 0.21925, 0.22422, 0.23479, 0.21454 0.23571, 0.22321, 0.22991, 0.23735, 0.21910
    11 0.03409, 0.03183, 0.03283, 0.02985, 0.03266 0.03244, 0.03358, 0.03321, 0.03178, 0.03667
    12 0.07878, 0.07949, 0.09528, 0.08933, 0.08681 0.08184, 0.08311, 0.08043, 0.08095, 0.09229
    13 0.25975, 0.24611, 0.25004, 0.24926, 0.24501 0.25451, 0.24255, 0.24556, 0.25274, 0.24281
    14 0.08352, 0.07954, 0.07785, 0.08106, 0.08970 0.07600, 0.07786, 0.07948, 0.07399, 0.07424
    15 0.16383, 0.16335, 0.18181, 0.15995, 0.16655 0.25026, 0.15628, 0.16659, 0.17284, 0.16853
    16 0.14687, 0.14001, 0.13760, 0.13386, 0.13418 0.14271, 0.13807, 0.13779, 0.13942, 0.13354
    17 0.07839, 0.08668, 0.06949, 0.08332, 0.08066 0.07173, 0.08871, 0.07996, 0.08486, 0.08030
    18 0.38214, 0.37570, 0.38646, 0.36281, 0.35981 0.42164, 0.38034, 0.39010, 0.38382, 0.38991
    19 0.11785, 0.12958, 0.10932, 0.11724, 0.13023 0.11887, 0.12382, 0.12853, 0.11512, 0.11252
    20 0.21005, 0.22809, 0.23223, 0.21008, 0.23244 0.05511, 0.05426, 0.05805, 0.05528, 0.06470
    21 0.32165, 0.33941, 0.32271, 0.33252, 0.31026 0.34234, 0.33385, 0.35519, 0.33184, 0.32969
    22 0.04487, 0.04193, 0.04333, 0.04482, 0.04416 0.04282, 0.04361, 0.04312, 0.04305, 0.04417

    sf100-disk

    Query Main suites1–5 wall s Candidate suites1–5 wall s
    1 6.11785, 6.08447, 8.11390, 7.68484, 6.42920 6.32938, 6.21031, 6.25275, 6.73584, 6.35054
    2 0.48873, 0.54370, 0.57366, 0.53722, 0.44110 0.52461, 0.52573, 0.51060, 0.51558, 0.46605
    3 3.58563, 3.53941, 3.93923, 3.54319, 3.52814 3.73250, 3.72948, 3.61671, 5.46345, 3.65132
    4 3.10222, 3.13102, 3.41045, 3.08404, 3.16887 3.21771, 3.15590, 3.12931, 4.09451, 3.13889
    5 3.80266, 3.83002, 3.87759, 4.19506, 4.27113 3.94541, 3.89920, 3.96940, 3.85559, 3.85984
    6 2.16120, 2.16848, 2.20000, 3.22538, 2.17556 2.17084, 2.18255, 2.15494, 2.76948, 2.13622
    7 3.94877, 3.89102, 3.90205, 3.85183, 3.99722 4.08574, 4.02073, 3.94233, 3.92645, 3.90924
    8 4.22113, 4.22546, 4.09026, 4.09039, 4.29433 4.35308, 4.28392, 4.24495, 4.23158, 4.20609
    9 6.88773, 6.86602, 6.59166, 6.41982, 7.18992 7.09429, 7.57871, 7.05772, 7.13757, 6.91544
    10 5.36359, 5.36925, 5.02632, 5.06871, 5.65201 5.65381, 5.64903, 5.55806, 5.53085, 5.55608
    11 0.61926, 0.59820, 0.58965, 0.55496, 0.55847 0.64934, 0.62870, 0.60531, 0.57425, 0.56906
    12 4.46913, 4.34473, 6.62386, 4.21262, 4.53431 4.50621, 4.45974, 4.42695, 4.40606, 4.53792
    13 3.74374, 3.76549, 3.78300, 3.49707, 3.93618 4.19000, 4.15229, 3.98064, 3.93466, 3.91257
    14 2.62677, 2.64449, 2.85878, 2.64597, 2.62425 2.66705, 2.66593, 2.63487, 2.64328, 2.57973
    15 5.87016, 4.93998, 5.68306, 5.05961, 5.07466 6.21756, 5.09695, 5.05656, 5.03622, 4.88187
    16 0.83491, 0.88648, 0.72701, 0.69214, 0.71401 0.92864, 0.92942, 0.81686, 0.74552, 0.69238
    17 5.07024, 3.66033, 3.66611, 3.69712, 3.70108 5.09660, 3.74330, 3.74497, 3.72445, 3.65067
    18 6.46235, 6.54127, 6.64548, 6.67136, 6.54958 6.94343, 6.67774, 6.50251, 6.50877, 6.07683
    19 5.85198, 5.58219, 4.92747, 5.32888, 5.08260 5.09639, 5.77198, 5.11172, 5.04094, 5.23163
    20 5.12339, 5.32745, 4.36004, 4.31688, 4.36632 2.95280, 3.37284, 2.86995, 2.83775, 2.84468
    21 9.75765, 9.92793, 10.97737, 9.74770, 9.91840 9.95110, 10.07397, 9.93643, 9.90482, 9.86817
    22 0.67695, 0.53050, 0.68236, 0.53401, 0.54460 0.60648, 0.55926, 0.56605, 0.74204, 0.54295
  4. XuPeng-SH commented on Nov 17, 2026

    @XuPeng-SH
    Contributor

    QA 交接(不是性能验收通过)

    #32816 已于 2026-11-17 07:40 UTC 合入 main,merge SHA 919c9fc6e3dc15e2d2e5c905078bd05dff24e2bc。修复在正向 membership 已要求的 key domain 上,于相关聚合之前插入安全 SEMI restriction,保留原谓词与每个存活 key 的输入 bag,并通过成本门控保留不支持/不划算的原计划;同时减少 general-ci literal-prefix LIKE 的重复折叠分配。完整 issue/PR 评论、最终评审与合入设计已核对,无明确未完开发修复或已确认适用当前版本的反例,交 QA 继续语义及性能验证,不关闭本项、不代表总项 #30838 验收完成。

    证据归属:本轮没有本地实测。作者历史对比 main 8e8708a8 与 candidate 7181ef4d,SF10 memory/disk、SF100 disk 的 Q20 wall 分别 -74.32%/-75.76%/-34.27%,Total 为 -3.94%/-4.52%/-0.89%;这些是各配置单进程、排除一轮 cold 后五轮带 profiling 的结果,不是无插桩最终 merge SHA 成绩。最终冲突合并后作者报告 planner 包及全 static gate 通过,核心 domain/prefix 逻辑不变但未重跑 benchmark。最终评审报告完整 planner/function 测试、snapshot/join/rejection probes、build/vet、5-query SQLite oracle、9,216,512-case prefix differential 与分配 microbenchmark 通过;SQLite 不等于真实 MO 服务。合并队列记录 CI Required 成功;本轮未独立读取原始逐项 CI/性能 artifact。

    重要未验收边界:原 SF100 Q13/Q16 wall +5.71%/+12.36% 信号必须保留,不能用 Q20 收益或 Total 平均掩盖。后续独立、未计分的 Q20→Q13→Q16 bracket probe 未复现稳定控制退化,但缓存历史不同,不替代 all22,也不是正式 noninferiority 证明。最终整体 head 性能等价、无插桩目标收益、独立更长平衡对比、适用 SF100 memory/mixed-I/O 和 umbrella 资源验收仍待 QA;benchmark 只执行并消费结果,未验证数据/表/schema/行数/参考结果/checksum。原 issue 的全部验收条款继续有效。

    建议 QA 先验证 unchanged Q20 的聚合输入/组数和 state 减少,再在相同整机预算下完成 Q1–Q22、Total 及控制查询的 wall/CPU/instructions/内存/IO 验证;区分 foreground、GC、后台与 kernel 成本。语义覆盖 duplicate/NULL outer keys、missing/all-NULL SUM、复合关联、非选择性/未知成本、unsafe/volatile/fallible 谓词拒绝、snapshot/binding identity、原 residual,以及 LIKE Unicode/畸形字节/ESCAPE/dynamic/fallback。正式确认的退化需回到研发,不以本交接替代性能验收或自动 backport。

  5. Ariznawlll commented on Nov 18, 2026

    @Ariznawlll
    Collaborator

    Note

    QA 性能面补充验证:大数据量真机基准已实测(main 517e169538)。SEMI restriction 的计划形态在真数据上确认;白盒全过。保持 OPEN 至研发/负责人裁定。

    QA 补充:大数据量真机验证(#30843 相关子查询候选限制)

    测试环境

    main 隔离实例 517e169538(SQL 实测确认);真数据集同上(lineitem 5.5M / partsupp 800k / part 200k)。

    白盒

    修复携带的 pkg/sql/plan/aggregate_membership_domain_test.go(191 行)+ restrictAggregateMembership 主链:本构建白盒全部 PASS(plan 包定向运行 ok)。

    真数据计划形态(Q20 形态,5.5M 行)

    EXPLAIN(截选):
    Aggregate [Group Key: part.p_name, sum(ps_supplycost*ps_availqty)]
      -> Join Join Type: RIGHT SEMI
           Join Cond: lineitem.l_suppkey = partsupp.ps_suppkey
           -> Table Scan on lineitem [Filter: shipdate 1995 window]
    
    • SEMI membership 限制确认在聚合之下(RIGHT SEMI 在 Aggregate 的输入侧),与修复设计一致。
    • 计时:111,111 个分组,sum(cost) 全量聚合 best 0.222s。

    真数据计时(复合场景)

    • Q20 形态 p_name LIKE 'part name 1%' + IN 子查询:best 0.222s
    • 事实侧 runtime filter 探针挂载正常(Runtime Filter Probe: lineitem.l_suppkey),与 SEMI 限制协同无冲突。

    结论

    • 计划形态、正确性、真数据性能记录已交付。性能对照(修复前 baseline)需研发专机;本基准证明修复后路径在 5.5M 行规模下健康、且 SEMI 处于设计位。
    • LIKE 前缀折叠的分配优化(func_like_prefix)随 PR 合入,白盒单测(func_like_prefix_test.go)本构建 PASS。
  6. Ariznawlll commented on Nov 24, 2026

    @Ariznawlll
    Collaborator

    结论

    测试不通过。原始选择性 Q20 的 work reduction 与耗时改善已复现,但必须覆盖的非选择性候选集对照出现可重复的性能退化;本 Issue 保持开放,交回原实现负责人继续处理。这里没有发现结果集错误。

    关键证据

    • 版本和对照:本轮开始冻结的官方 main@9fdbc415b9171dc16e0c02f2b366a3dc612516fd,实际服务 git_version() 完整匹配。SDK 构建树过滤了非运行文档,Go build-info 的 vcs.modified=true;构建时已检查生产 pkg/cmd 没有相对该官方源码的修改,未将整棵 SDK 工作树声称为 clean。对照 95b7755802da464c1adad651122616c269209cf1 是本地 QA commit:在同一 main 上仅撤销 PR #32816 的四个生产文件,包含 membership rule 与 LIKE 改动,不是官方旧 release,也不能把差值全部归因于单个 SEMI JOIN 函数。相同 Go 1.27.1、GOAMD64=v3、SIMD、funcalign64 与构建时间,两个 ELF 的 SHA256 分别为 8a8f8efa105d995093a6071beb0d2e8d14f06d1eece763e8ea8d0052325e1d2c / ca84f93ed1671bb01d7bf6c3189f80bf1d205c1b90041ff958767dee0254ece0。
    • 环境与计量:独立 SF10 数据镜像,8 logical CPU、NUMA interleave、32 GiB whole-application hard cap,CN SHARED memory cache 16 GiB。编码数据/WAL/服务日志/计时报告放专用 tmpfs;软件与客户端也计入预算。记录实际 cache metrics(包含默认 index-file cache,未声称所有 disk cache 配置均为零)。正式 warm 样本的 MO/client /proc/io 和 cgroup 物理读写均为 0;spill watcher 无事件/无溢出,memory-limit hits/OOM 为 0,主机无 swap。内核没有 PSI 接口,因此未声称已取得 PSI 证据。早期磁盘镜像测试发现后台写入,已排除出严格 RAM 结论。
    • 原始 qualification 单独计分:完整 Q1–Q22,Q15 保留 CREATE/SELECT/DROP 生命周期且消费完整结果;8 个独立进程按 AB/BA/BA/AB 配对,每进程排除 1 套 cold,再跑 5 套 warm,共 880 个 warm query lifecycles。原始 Q20 的 paired wall change 为 −62.70%,小样本 95% 区间 [−64.68%, −60.61%];whole-app CPU −67.56%。全套 Total 为 −3.65%,区间跨 0,不能宣称 Total 确认改善。
    • 独立加长控制复验:Q20 只将 p_name LIKE 'forest%' 改成 p_name LIKE '%',作为本 Issue 明确要求的非选择性对照,不修改 qualification 文件、不混入 Total。18 个新进程遍历 A0/A1/B 的六种顺序;A0/A1 是完全相同的官方 ELF。每进程排除 22-slot cold,再独立执行 Q19、此 Q20 各 16 次。以六个进程块的 log-ratio、Student-t(df=5) 计算:非选择性 Q20 wall +10.15% [ +6.43%, +14.00% ];whole-app CPU +11.82% [ +8.26%, +15.50% ]。两边进程中位耗时分别为 0.79249 s / 0.71662 s。六块 wall 原始变化为 +4.85%、+7.85%、+10.61%、+15.35%、+12.14%、+10.39%,全部同方向。相同 ELF 的 A/A 为 +2.12%,区间 [−0.54%, +4.84%]。Q19 的 +2.01% 区间 [−1.93%, +6.12%],仍不确定,未算作确认退化或等价。
    • 独立、不计分的原生计划与正确性诊断:原始 forest% 下,官方计划在 Aggregate 前有 SEMI JOIN,实际直接上游输出 98,107 行、聚合 58,782 groups;撤销对照为 9,099,165 行、5,441,669 groups。非选择性 % 下官方仍加入 SEMI JOIN,但聚合上游仍为 9,099,165 行、5,441,669 groups,与无该 rule 的对照完全相同;新增 Join 的 reported MemorySize 为 583.63 MiB。同一官方版本将该 NOT NULL 列的 LIKE '%' 换成等价 TRUE 后,Aggregate 上游回到直接 Table Scan,行数/groups/最终结果不变。这证明非选择性路径增加了没有减少聚合工作量的限制步骤;计划中的 Aggregate 自身 inputRows=0 是 analyzer 口径,未将它误当成真实零输入。
    • 白盒边界:现有 aggregateMembershipCostAllows 已检查 NDV 与预计 saved/extra;原 UT 也覆盖人为设置 selectivity=1 的拒绝。因此这里不是“完全没有成本判断”。但真实 SF10 LIKE '%' 仍到达了额外 SEMI 路径;需要核对真实统计估算与准入输入,不能只用该 mock UT 代替负对照。具体哪一个估计值失准尚未注入采集,不将它当作已确认的细分根因。
    • 结果与已有回归:qualification 的 A/B 全 Q1–Q22 完整结果 bag 在计时外逐项一致;诊断中的 Q20 forest% 返回 1,804 行,非选择性 % 与等价 TRUE 均返回 4,054 行,A/B 完整 bag 也一致。NULL、重复/缺失候选 key、空/all-NULL aggregate 等确定性语义对照已补入同一个 MOTR PR #374,具体 driver;这些功能回归不能替代此项性能门槛。正式 RAM 原始证据与分析归档 SHA256 为 770ce8cd3b9e8aba6013596f938ab34478ed9b3c883724e8faf6523dc913fde5,包含逐臂记录、分析 JSON、实际计划与 SQL。
    • main 移动范围:测量结束核对官方 head 为 1b50c67ceaf39e6f6ff9b567c579b2843ea46fc6;相对已测版本的 4 个新提交没有修改本次 optimizer/membership/LIKE 路径。实际运行版本仍是上面的冻结 SHA,未声称已运行新 head。

    非选择性 SQL(标准 SF10 schema/data;该次计分 SQL 完整如下):

    select
    	s_name,
    	s_address
    from
    	supplier,
    	nation
    where
    	s_suppkey in (
    		select
    			ps_suppkey
    		from
    			partsupp
    		where
    			ps_partkey in (
    				select
    					p_partkey
    				from
    					part
    				where
    					p_name like '%'
    			)
    			and ps_availqty > (
    				select
    					0.5 * sum(l_quantity)
    				from
    					lineitem
    				where
    					l_partkey = ps_partkey
    					and l_suppkey = ps_suppkey
    					and l_shipdate >= date '1994-01-01'
    					and l_shipdate < date '1994-01-01' + interval '1' year
    			)
    	)
    	and s_nationkey = n_nationkey
    	and n_name = 'CANADA'
    order by
    	s_name;

    待解决点

    • 非选择性候选集应拒绝/降低额外 restriction 成本,或通过可比较数据证明其总收益;须复测上述对照及其 startup/build/retained state。不得用选择性 Q20 或 Total 收益抵消已确认控制退化。
    • SF100 的独立 RAM、mixed-I/O 数据均已准备,但本轮尚无其计分结果;不能据 SF10 功能和目标收益关闭 Issue。修复后仍须补齐这些验收及对应性能回归。
  7. XuPeng-SH commented on Nov 25, 2026

    @XuPeng-SH
    Contributor

    补充已合入的专项复测范围(保持 Ariznawlll / OPEN):#33222 main merge 46c2d3eb08f8e0c7b8c6a434ec641dc2b3ceeadb 修正 match-all LIKE 的成本估算,作者在 SF0.1 用同数据对照确认全域非空列不再引入无收益 SEMI JOIN,并保留小候选集和高 NULL 比例下有收益的路径。独立复审定向 planner 测试通过;本轮未重跑。

    请在实际包含合并 SHA 的版本复跑此前 SF10 的同机 A/B:原 forest% 正对照、LIKE '%' 负对照与等价 TRUE,分别比较实际 Aggregate 输入/组数、wall/CPU 及峰值开销,并校验结果集。旧版本 +10.15% 反例不能直接判新版本失败,也不能用 SF0.1 代替原反例。SF10/SF100 的 RAM 和 mixed-I/O qualification 未闭环。

  8. Ariznawlll commented on Dec 2, 2026

    @Ariznawlll
    Collaborator

    结论

    测试通过(限本次与用户确认的已交付实现及实际验证范围),按该范围关闭本子任务。SF10/SF100 同机 A/B 的完整 Q1–Q22 结果校验通过,目标 Q20 有稳定耗时收益。本次关闭不代表原 umbrella 协议中的独占机器、严格 RAM 与全部资源计量条款均已验收;这些边界明确保留,不再作为本子任务继续扩展测试的关闭前提。

    关键证据

    版本与对照

    • 冻结官方 main 源码:32ffdd4ac2722972be184af63906c8f23901e323,包含 match-all LIKE 成本修复 #33222。不是将发布评论时的最新 main 冒充实测版本。
    • A 为上述源码构建;B 为同源码仅禁用 builder.restrictAggregateMembership(rootID) 的 QA 对照,B 不是官方旧版本。相同 Go 1.27.1 / SIMD / GOAMD64=v3;构建关闭 buildvcs 自动采集,版本由构建注入,不能仅凭二者显示同一 CommitID 就声称 B 未修改。
    • A ELF SHA256:d6fb82f9f8e6c7dfd5469bbdfbbbc635d8ebd5b8ea05c048b2bb40a8d6bafecc。
    • B ELF SHA256:9a6af2496a76df630159aa61e5ab1ad58106c963d8a46b5849224ca06c6c42b。

    完整 qualification SQL 对照

    在 128 独立实例和端口执行,同机比较,未停止其他任务。按固定 qualification DDL 重新建表并加载 SF10 / SF100;lineitem 行数分别为 59,986,052 / 600,037,902。每个规模独立执行 8 臂 ABBABAAB,每臂排除 1 套参考/预热,再计时 5 套 Q1–Q22;每个规模 880 次计时 query lifecycle。Q15 保留创建 view、查询、删除的生命周期。

    每臂参考阶段消费完整结果,比较排序后的完整结果 bag 指纹及列元数据;计时阶段消费全部结果并检查行数。两个规模全部 22 条查询的参考结果及元数据在 A/B 间一致;这属于 A/B 一致性验证,不声称本轮使用第三方数据库逐行 golden。

    以每臂五次 wall 中位数形成四个配对,再以 log-ratio、Student-t(df=3) 计算区间;负数表示 A 耗时降低:

    完整 Q1–Q22 中的 Q20 耗时变化 95% 区间
    SF10 −32.00% [−34.14%, −29.80%]
    SF100 −39.69% [−40.85%, −38.50%]

    SF100 的 Q20,各臂中位数再取中位数:A 4.7870 s / B 7.9580 s;服务进程 CPU 为 A 25.73 s / B 53.48 s。CPU 仅为服务进程口径,不是 whole-application 计量。

    SF100 全套 8/8 臂完成,所有服务退出码为 0。其他查询 wall 配对变化依次为:Q1 −0.28%、Q2 −0.07%、Q3 −1.28%、Q4 −1.25%、Q5 −0.93%、Q6 −0.03%、Q7 −0.68%、Q8 −0.15%、Q9 −2.86%、Q10 −0.84%、Q11 +2.03%、Q12 −0.41%、Q13 +0.17%、Q14 −0.56%、Q15 +0.18%、Q16 +1.62%、Q17 −1.05%、Q18 −2.52%、Q19 +0.11%、Q21 −1.39%、Q22 −1.40%。所有正变化的区间都跨 0;未发现本轮统计上确认的控制退化,但这不构成正式 noninferiority 证明。

    负对照与较慢信号的复核

    • 单独 Q20 控制试验覆盖原始 forest%、非选择性 LIKE '%' 和等价 TRUE,结果一致。SF10 的非选择性 wall 变化为 −1.21% [−4.97%, +2.70%],TRUE 为 +0.02% [−2.19%, +2.28%];本环境未复现旧记录中的稳定 +10.15% 退化。
    • SF100 单独控制试验中,非选择性 +4.50% [−11.37%, +23.20%]、TRUE −0.70% [−2.62%, +1.26%]。非选择性区间较宽,保留不确定性,不将其写成性能等价或原严格 RAM 反例已被同条件验证。
    • 这些较早的单独 Q20 试验遇到服务启动前端口冲突,失败尝试保留;调整本任务端口后补齐未执行的臂。它们不是一份从头无失败的运行,不混入后来的完整 qualification 计分。
    • SF10 Q6 曾在加长 AB 中出现 +2.05% 信号,随后额外执行 18 臂 A0/A1/B 全排列(A0/A1 为相同二进制),每臂 16 次:A0/B −0.56% [−1.57%, +0.45%],A1/B −0.04% [−1.45%, +1.39%],A0/A1 −0.52% [−2.51%, +1.51%]。未复现稳定退化;Q6 A/B 计划文本一致。保留早期信号,不凭一次较慢值直接归因产品。

    回归去向

    此前 MOTR #374 已由 MOTR #403 汇总替代;#403 已于 2026-12-01 合入。对应语义控制 driver保留 NULL、重复/缺失候选键、空/all-NULL 聚合等确定性检查。这是功能回归去向;不将其声称为上述专机性能基准已纳入每日调度。

    待解决点

    • 实测机器保留 Java 和其他负载,没有独占。GOMAXPROCS=8、GOMEMLIMIT=12 GiB;后者是 Go 软内存目标,不是进程或整机硬限制。
    • SF100 全套计时阶段服务进程累计物理读取约 5,813 GiB,不能称纯 RAM 测量;也不等同于完成 umbrella 严格 mixed-I/O 协议。
    • 未完成 whole-application 硬预算、完整 cache/spill/swap/pressure、instructions 和全路径峰值资源的统一验收。本次不把既有功能/计划证据替代这些计量,也不改写旧版本退化记录。
    • 本次按用户要求以已交付实现、实际规模验证和已合入回归收尾;上述专项计量边界保留给父任务 #30838 的整体性能验收范围,本次没有另造一个未经复现的产品 bug,也未修改父任务状态。

    最终结论:按本次确认的收尾范围测试通过并关闭本子任务。已通过:SF10/SF100 完整 Q1–Q22 A/B 结果一致性、目标 Q20 耗时收益及上述独立控制复核;未完成:原 umbrella 严格 RAM/mixed-I/O 与完整资源协议验收。关闭不表示这些原始条款已全部测试通过。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/subtaskseverity/s0

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions