Skip to content

perf(vector): reuse NULL state in constant row projection - #31988

Merged
mergify[bot] merged 4 commits into
matrixorigin:mainfrom
aunjgr:perf/const-projection-null-checks
Nov 1, 2026
Merged

mergify[bot] merged 4 commits into
matrixorigin:mainfrom
aunjgr:perf/const-projection-null-checks

Conversation

@aunjgr

@aunjgr aunjgr commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

Related to #30845

Related to #30838

Benchmark and attribution evidence: #30845 (comment)

What this PR does / why we need it:

Reuse the selected source row’s NULL status across constant-projection provenance admission and publication. Flat vectors use their row bitmap; constants keep the existing scalar NULL checks. Preserve alias cloning, copy-on-write and grouping admission before this inspection. Empty output invokes the original typed setter and clears prepared/binary/string/grouping metadata in the original order.

This removes repeated NULL checks in the join row-projection path while keeping the global predicate, vector layout, typed setters and public APIs unchanged.

Validation

  • Vector owning-package tests and the colexec consumer tests pass. Reused setter, NULL/constant/grouping, prepared/binary/string provenance, readonly alias/COW and allocation-error fixtures; the existing metadata fixture now checks nonempty-to-empty cleanup.

  • Four balanced component pairs improve all seven actual projection modes: flat/text about18%, nullable/borrowed about31%, constants8–15%, empty output3.31%, with no extra per-call allocation.

  • Independent local SF10 Q3/Q13/Q20/Q21 check: four balanced pairs,16measured warm calls/query. Q21 median paired latency -3.55% (-4.13% to -2.88%); the three previous regression controls have no directional slowdown signal.

  • Full Q1-Q22: four qualified balanced pairs,5warm calls/query; Q21 median paired -3.72% (-5.87% to -0.52%). Same eight physical CPUs, effective16GiB CN cache,32GiB whole-application cap, cold excluded, original SQL and complete consumption. Scored arms pass original resource gates with zero physical I/O/spill/swap/OOM. Two CPU/compiler-contaminated pairs were excluded in full and replaced under a predeclared resource-only protocol with identical source/ELFs/settings/order; excluded attempts remain visible.

  • Q4 uncertainty is retained: a longer control run gave +1.50%. A larger predeclared six-triplet A/A/B check, using two identical main executables, did not reproduce it: fix/A -0.12% (-4.92% to +0.59%), fix/B -1.23% (-6.47% to +0.34%). Q4 remains inconclusive; these data do not prove equivalence or erase the earlier signal. Positive inconclusive estimates and all raw campaigns remain in the linked evidence. Broader SF100/mixed-I/O acceptance stays open.

  • Fresh authoritative-main merge and full mandatory pre-push gate pass, including package graph, molint, license headers/dependencies and repository-wide lint (zero reported issues).

@aunjgr
aunjgr requested a review from XuPeng-SH as a code owner November 1, 2026 19:08
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@XuPeng-SH

XuPeng-SH commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-local · done

Commit: 1c919006777fd58de7f230362751a68b3492ea33

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mo-bot review · mo-bot-local · review

Commit: 1c919006777fd58de7f230362751a68b3492ea33

Assessment: approve

No actionable defects found. The scoped optimization preserves NULL classification, alias handling, allocation ordering and metadata cleanup.

Model: gpt-6-astra / xhigh

Session: 01a1869d-820c-7212-9788-aecfb86a4141 · slot 0 · generation 2

Validation:

  • Reviewed the complete two-file delta, affected consumers, existing regression oracles and supplied discussion.

  • Static audit passed at the clean frozen head: patch identity, git diff --check, unchanged measured vector delta and complete discussion coverage. Receipt: checks/1793564111438586949-3.json; log: validation-audit.log.

  • Independently recomputed all 31 reported query estimates and four Q4 contrasts from supplied benchmark samples; arithmetic matches.

  • Frozen-head CI reports successful build, UT, coverage, SCA and compose checks.

Limitations:

  • No local Go tests or benchmarks were rerun. Raw CI logs and original benchmark executables/resource receipts were unavailable.

  • Q4 remains inconclusive: the earlier +1.50% signal was not reproduced by the larger identical-binary control study. This does not prove equivalence.

  • Broader SF100/mixed-I/O acceptance remains open in the related issues.

@mergify mergify Bot added the queued label Nov 1, 2026
@mergify
mergify Bot merged commit 55a1a2e into matrixorigin:main Nov 1, 2026
@mergify

mergify Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

✅ Merged into main as 55a1a2e at 20:16 UTC

Less than a minute in the queue, with no time running CI.

So far

  • ✅ Entered the queue Sun 1 Nov, 20:16 · rule main · triggered by rule Automatic queue on approval for main
  • ✅ Checks skipped · PR is already up-to-date
  • ✅ Merged 20:16 · 55a1a2e · squash
3 merge conditions met
  • #review-threads-unresolved = 0 · required by GitHub branch protection
  • github-review-approved · required by GitHub branch protection
  • any of · required by GitHub branch protection:
    • check-success = CI Required
    • check-neutral = CI Required
    • check-skipped = CI Required

Times in UTC · dashboard · how the merge queue works

@mergify mergify Bot removed the queued label Nov 1, 2026

This branch was previously deployed

1 inactive deployment
ci — 1c919006 Deployed Nov 1, 2026 by mergify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants