Skip to content

ROX-32721: Add RunSelectDirectFn for direct pgx row scanning#20028

Draft
dashrews78 wants to merge 1 commit intomasterfrom
dashrews/list-alert-v2-32721
Draft

ROX-32721: Add RunSelectDirectFn for direct pgx row scanning#20028
dashrews78 wants to merge 1 commit intomasterfrom
dashrews/list-alert-v2-32721

Conversation

@dashrews78
Copy link
Copy Markdown
Contributor

Add a companion to RunSelectRequestForSchemaFn that reuses the full
query builder pipeline (SAC, WHERE, ORDER BY, LIMIT, pagination) but
scans rows with pgx rows.Scan instead of scany reflection. This
eliminates per-field heap allocations on hot paths where the column
layout is known at compile time.

Benchmarking against the alert ListAlert query showed scany reflection
was the primary bottleneck -- switching to direct scanning yielded
2-3x latency improvement and ~8x memory reduction.

Partially generated by AI.

Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com

Description

change me!

User-facing documentation

Testing and quality

  • the change is production ready: the change is GA, or otherwise the functionality is gated by a feature flag
  • CI results are inspected

Automated testing

  • added unit tests
  • added e2e tests
  • added regression tests
  • added compatibility tests
  • modified existing tests

How I validated my change

change me!

Add a companion to RunSelectRequestForSchemaFn that reuses the full
query builder pipeline (SAC, WHERE, ORDER BY, LIMIT, pagination) but
scans rows with pgx rows.Scan instead of scany reflection. This
eliminates per-field heap allocations on hot paths where the column
layout is known at compile time.

Benchmarking against the alert ListAlert query showed scany reflection
was the primary bottleneck -- switching to direct scanning yielded
2-3x latency improvement and ~8x memory reduction.

Partially generated by AI.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Apr 15, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@dashrews78
Copy link
Copy Markdown
Contributor Author

dashrews78 commented Apr 15, 2026

@github-actions
Copy link
Copy Markdown
Contributor

🚀 Build Images Ready

Images are ready for commit acc538d. To use with deploy scripts:

export MAIN_IMAGE_TAG=4.11.x-659-gacc538da5e

1 similar comment
@github-actions
Copy link
Copy Markdown
Contributor

🚀 Build Images Ready

Images are ready for commit acc538d. To use with deploy scripts:

export MAIN_IMAGE_TAG=4.11.x-659-gacc538da5e

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 15, 2026

Codecov Report

❌ Patch coverage is 46.51163% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.61%. Comparing base (d721274) to head (acc538d).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
pkg/search/postgres/select.go 46.51% 17 Missing and 6 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #20028      +/-   ##
==========================================
- Coverage   49.61%   49.61%   -0.01%     
==========================================
  Files        2765     2765              
  Lines      208649   208686      +37     
==========================================
+ Hits       103523   103535      +12     
- Misses      97471    97487      +16     
- Partials     7655     7664       +9     
Flag Coverage Δ
go-unit-tests 49.61% <46.51%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant