Repository navigation
fix(plan): price backfill filter setup when ranking regular indexes - #33501
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
This pull request is merged. |
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 1da74d3d92af454f96cf64037917d70076217426
Assessment: request_changes
The cost change reuses the existing preparation estimate and selected the intended covering scan in a three-CN public probe. The new wide-key regression test, however, depends on the host CPU count and makes the planner suite fail on a 16-CPU host.
Model: gpt-6.1-terra / max
Session: 01a22af4-cf2a-7f70-88e4-931bbf57d739 · slot 2 · generation 14
- P2
pkg/sql/plan/apply_indices_test.go:4892: Run TestEncodedIndexCostChoosesAcrossCoveringAndBackfill on a host where the planner estimates 16 local readers.
Impact: The new wide-key subtest expects the backfill index, but the existing admission estimate rejects that candidate at 16 readers. The test selects the covering index instead and causes the full planner package test run to fail.
Evidence: The unmodified focused test and full planner suite failed at GOMAXPROCS=16; the focused test passed at GOMAXPROCS=1. Cost tracing showed the narrow backfill's admission work exceeding the base-scan estimate at 16 readers. A diagnostic test-only overlay that set max_dop to 1 passed on the same 16-CPU host. Make the fixture's DOP deterministic, as the nearby index-cost tests do, or choose inputs that keep the backfill admitted across supported reader counts.
Validation:
-
Private runtime preflight and native provenance checks passed.
-
The full planner suite failed at the new wide-key test; the failure was reproduced in isolation. The one-CPU control and test-only max_dop diagnostic passed. Logs and receipts are listed in validation-record.md.
-
Selected planner controls and the public LikePrefixIndex and IntegerIndexAccess integration suites passed.
-
On separately generated 1M-row three-CN fixtures, the base production code chose an index join and the candidate chose a covering scan. Both returned the same 50 rows as forced-index and table-scan controls; prepared execution and DELETE rollback controls passed.
-
A one-CPU full-suite control also failed unrelated rollup and shuffle tests; those selected failures reproduced with the base planner code.
Limitations:
- The public comparison regenerated equivalent data in separate clusters; it did not replay an identical persisted snapshot or independently reproduce the reported 30M-row measurements.
1da74d3 to
d6ed3b8
Compare
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: d6ed3b85065ba6839b7d87e3f1a9748c9e95dc22
Assessment: approve
The change reuses the existing backfill-preparation estimate for candidate ranking while retaining the separate admission estimate and its safeguards. The earlier CPU-dependent test failure is resolved by fixing the fixture’s session DOP; the focused cases and full planner package pass at 16 CPUs.
Model: gpt-6.1-terra / max
Session: 01a22b78-8d27-7672-ac2d-c513f3728009 · slot 3 · generation 10
Validation:
-
Private runtime preflight and native provenance checks passed: preflight.log and native-check.log, with receipts checks/1796030971323011003-3.json and checks/1796031109414328932-3.json.
-
The changed planner cases passed, and the full pkg/sql/plan package passed on the assigned head at GOMAXPROCS=16: focused-planner.log and planner-suite.log, with receipts checks/1796031356989762989-3.json and checks/1796031453417520720-3.json.
-
Package go vet, gofmt, and git diff --check passed; their retained logs correspond to receipts checks/1796031553068311888-3.json, checks/1796031602419805176-3.json, and checks/1796031608999537246-3.json.
-
Reused the prior same-PR public SQL evidence after verifying that the scoring file is identical and the baseline overlay matches this merge-base. The retained three-CN comparison returned matching rows and selected covering access with the candidate; retained integer-index and LIKE/IN tests also passed.
-
All five discussion items are recorded in discussion-assessment.json; discussion-audit.log and checks/1796031621693044863-3.json confirm key coverage.
Limitations:
-
The prior three-CN comparison used separately generated equivalent fixtures. The author’s 30M-row measurements and full race run were not independently reproduced.
-
The frozen CI snapshot had planner-related jobs queued or in progress. The separate DELETE optimization described in issue #32127 remains outside this PR’s stated scope.
## What type of PR is this? - [x] Documentation - [x] Test and CI ## Which issue(s) this PR fixes: Related to #30150 for the required check on cancelled producers. The rollout uses the control runner support from #28717 and addresses the queue observed on #33494 and #33501. ## What this PR does / why we need it: On #33501 the old required check waited 7m35s for a hosted runner and ran for four seconds. The replacement workflow was unable to start preflight during that wait. On #33494 the old required check and the cancellation controller also queued together. [Required check from #33501](https://github.com/matrixorigin/matrixone/actions/runs/46374859836/job/141702801415) · [Required check from #33494](https://github.com/matrixorigin/matrixone/actions/runs/46368023504/job/141705095759) The repository setting for preflight, the required check and the cancellation controller now selects the shared CS medium pool. This update records the operational setting and how to restore hosted execution and release a superseded run if a runner label stops serving work. Two simultaneous jobs using the shared label started on MTY and RUH in 7 and 11 seconds. A hosted reference submitted with them waited 61 seconds. JED and MNL2 also ran the same checkout, PR metadata read and required-check verification. [Shared-label comparison](https://github.com/matrixorigin/matrixone/actions/runs/46378188128) · [JED and MNL2](https://github.com/matrixorigin/matrixone/actions/runs/46380046197) In a branch-isolated handoff, cancellation made the old required check fail and the successor reached a runner 50 seconds after its workflow was created. A second exercise held the old required check on a nonexistent label, restored the hosted default for the successor, and used GitHub's force-cancel operation on the obsolete probe. The 65 existing scope and cancellation tests passed locally. [Cancelled producer](https://github.com/matrixorigin/matrixone/actions/runs/46379765379) · [Successful successor](https://github.com/matrixorigin/matrixone/actions/runs/46379836410) · [Hosted recovery](https://github.com/matrixorigin/matrixone/actions/runs/46380130392) After the repository setting changed on November 30 at 08:20 UTC, the production preflight picked up this main PR on RUH in 15 seconds and a 4.2-dev PR on MTY in 5 seconds. The cancellation controller for this PR picked up on RUH in 10 seconds. [Main preflight](https://github.com/matrixorigin/matrixone/actions/runs/46380837572/job/141720723388) · [4.2-dev preflight](https://github.com/matrixorigin/matrixone/actions/runs/46381492276/job/141721422578) · [Cancellation controller](https://github.com/matrixorigin/matrixone/actions/runs/46380847802/job/141719313212) On main PR #33502 the deployed controller picked up on RUH in 11 seconds, waited the existing grace period, and automatically force-cancelled the superseded run while its hosted required check was queued. The successor preflight picked up on MTY in 5 seconds. From the new workflow being created to preflight starting took 2m48s. This documentation PR's required check also passed on MTY after a 6-second queue. [Automatic cancellation](https://github.com/matrixorigin/matrixone/actions/runs/46382877728/job/141725947578) · [Successor preflight](https://github.com/matrixorigin/matrixone/actions/runs/46382871951/job/141727210246) · [Passing required check](https://github.com/matrixorigin/matrixone/actions/runs/46380837572/job/141731647152)
What type of PR is this?
Which issue(s) this PR fixes:
Refs #32127. This fixes the covering SELECT plan described there. The DELETE case still requires base row IDs.
What this PR does / why we need it:
A legal covering scan lost to an index backfill because the ranking charged one unit per emitted primary key for filter preparation. The existing preparation estimate only affected admission against a table scan. Use one reader of that same estimate for ranking and keep the existing reader and probe estimates for admission, including the optimistic bound for prepared ranges.
On an identical persisted 1M-row fixture with three CNs, the automatic covering SELECT reads 1 block, down from 72. The primary-key-only variant reads 16, down from 135. On a compacted synthetic 30M-row snapshot replayed on each binary, the original SELECT reads 1 block, down from 1,904. The primary-key-only SELECT reads 3 blocks, down from 3,138. The original query returns the same 25 rows on both builds, with equivalent FORCE INDEX and table-scan results. A 120k-row clustered control still chooses a narrow backfill over a wide covering key and reads about 206 KiB compared with 397 KiB for the forced covering plan.
The result checks include an empty predicate range, a broader range, prepared literal and NULL bounds, and a DELETE rollback that restores all seven targeted rows. The two catalog-order regression cases select backfill on the baseline and covering on this branch. The wide-key test verifies the reverse choice.
A separate LIKE with IN control returns the same rows as a table scan, including exclusion of an IN value outside the prefix. The covered projection uses the index and the noncovered projection uses backfill.
Validation passed with Go 1.27.1 on Linux/amd64. The full planner package passed under
-raceon the identical patch before the allocator-profiling rebase. At the earlier rebased headf1c704034f, 420 selected planner tests and 26 allocator configuration/profiling tests passed under-race. That clean binary reproduced the 30M-row plans and results. Incremental formatting,go vet,molintand configuredgolangci-lintpassed with zero findings.Review follow-up
The ranking fixture now sets
max_dop=1through the session variable path. All three cases pass atGOMAXPROCS=1and16. With the baseline scorer at 16, both catalog-order cases still select backfill and fail their covering expectations. The wide-key backfill control passes.After rebasing onto
e1256c70dc, the fullpkg/sql/planpackage passed under-raceatGOMAXPROCS=16. Incremental formatting, vet, molint and golangci-lint passed with zero findings. The integer-index, LIKE-prefix, role-filtered EXPLAIN and catalog AUTO_INCREMENT SQL integration tests passed on the same rebased production code.