Repository navigation
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? |
|
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: ca6358cdfa0903c0aaa45bb1e5370a386da33e7c
Assessment: request_changes
The new correlated-point access strategy requires a reviewed versioned design. It reuses existing encoding/filter owners, but adds a proposal lifecycle, query-wide resource policy and value-dependent prepared replanning that the existing primary-prefix design does not cover.
Model: gpt-6.1-sol / max
Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0
- P2
pkg/sql/plan/composite_key_points.go:515: This introduces a cross-phase correlated-point access strategy, including proposal capture/revalidation/publication, query-wide budgeting and execution-value-dependent prepared-plan admission. This materially expands the planning architecture; its 815 changed production lines also exceed the repository's feature/refactor design threshold.
Impact: The mandatory design-first gate remains unmet: the frozen PR/evidence links no reviewed versioned design covering these policies. Implementation approval must wait for that design decision. This is a design-review gap, not a demonstrated runtime failure.
Evidence: The unchanged base contract in .agents/skills/mo-dev/references/feature-design-review.md:11-95 requires a versioned design and traceable approval before implementation review for this architectural scope. The added state starts here; prepared admission changes at composite_key_points.go:171 and late publication is wired through query_builder.go:4571-4598. docs/design/20261024-secondary-index-primary-prefix.md covers existing lowering/index selection, not these new policies. Add or link the exact reviewed revision addressing the ownership, cache, resource and performance decisions, and record design approval; extending the existing design is sufficient.
Validation:
-
Read the complete 16-file delta, linked issue #32365 and both indexed discussion entries; retained review-plan.md, change-map.json, source-closure.md and discussion-assessment.json.
-
Assigned check-run static probe passed at the frozen head: clean source, unchanged base design policy, gofmt for 13 changed Go files, four display-only blockfilter result substitutions, and matching 56-statement SQL/result fixtures. Receipt and output are retained under checks/ and static-review-v2.log.
-
Independently traced reader AND preference, vector cleanup ownership and EXPLAIN redaction. Author-reported owning-package normal/race and two 56/56 BVT runs were considered as attributed reports.
Limitations:
-
Dependent tuple derivation, proposal publication and prepared-cache correctness review stopped at the mandatory design gate; no local Go or SQL tests were compiled or executed.
-
Raw author validation artifacts were not supplied, and core CI jobs were still in progress in the frozen snapshot. Reported performance measurements used one CN alongside a race run and do not establish general latency or multi-CN costs.
|
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: 20fe5447c749a96c567c98667037060871660279
Assessment: approve
The prior design gap is resolved. Bounded proposal capture is justified by intervening access rewrites and reuses existing encoding, prepared-cache and reader owners. No actionable correctness or design issue remains.
Model: gpt-6.1-sol / max
Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0
Validation:
-
Reviewed all 20 changed files, affected consumers, linked issue and four discussion entries; saved the change map and discussion assessment.
-
Full planner, EXPLAIN and readutil normal tests passed. Fourteen focused tests across four packages and the public binary-prepared SELECT/UPDATE test passed.
-
Static checks passed for source/patch identity, formatting, reviewed design, discussion coverage and SQL/result alignment. Twelve receipts and retained logs are reconciled in validation-ledger.json.
Limitations:
-
The full frontend run failed at unchanged Test_openNewFile_nilCtx because its fixture writes beneath the read-only checkout; affected frontend tests passed separately.
-
Core CI was pending in the supplied snapshot. Local race, mo-tester and performance runs were not repeated; author reports remain attributed.
What type of PR is this?
Which issue(s) this PR fixes:
issue #32365
Related 4.2-dev implementation: #32371.
What this PR does / why we need it:
A predicate like
tenant = ? AND ((session = ? AND request = ?) OR ...)describes a small set of complete composite primary keys, but previously scanned the entire tenant prefix. Derive a bounded set of correlated keys as a necessary scan filter and retain the full original predicates.The versioned design covers ownership, cache semantics, bounded resource charges, cancellation and performance. Its amended revision received an independent
gpt-6.1-terra/maxdesign PASS (session01a1bc7a-177e-7950-b176-bd33aabe982f). The original implementation preceded the versioned document; the deferred-admission correction was designed and approved before implementation.Validation
plan/explainandreadutilnormal/race results remain applicable to their unchanged code. Focused frontend cache/retry and binary prepared SELECT/UPDATE tests under race, including index cache reuse, large/small/NULL rebinding, error/warning and rollback controls.gofmt,go vet, repository-pinnedmolintandgolangci-lintfor the changed packages and affected consumers, license headers, andgit diff --check.Local performance
On a Ryzen 9 7900X with Go 1.27.1, one local CN and a persisted 100,001-row table, three fresh-cluster samples of ten warmed binary-prepared COUNT executions over 50 scattered keys had medians of 615.7 ms on the main baseline and 78.2 ms with this change. Scan input was 100,001 versus 50 rows; blocks touched were 14 versus 13. The two-point case read two rows, and binary SELECT and UPDATE returned or changed the expected rows. These separate local batches are illustrative, not a general latency guarantee or evidence of proportional block-I/O savings.
The planning work is not free. In three paired local microbenchmark samples, 50-point planning went from 1.27 to 1.53 ms, 831 KB to 1,038 KB, and 16,209 to 18,096 allocations per plan; value-dependent point plans are replanned. The shared numeric-prefix change reduced the updated 50-point case by 22.4 KB and 400 allocations compared with the same deferred-admission code before that change; these short timing samples do not establish a CPU speedup from that particular reduction.