Skip to content

ROX-32721: Switch SearchListAlerts and WalkAll to column projection#20032

Draft
dashrews78 wants to merge 3 commits intodashrews/migration-32721from
dashrews/projection-read-path-32721
Draft

ROX-32721: Switch SearchListAlerts and WalkAll to column projection#20032
dashrews78 wants to merge 3 commits intodashrews/migration-32721from
dashrews/projection-read-path-32721

Conversation

@dashrews78
Copy link
Copy Markdown
Contributor

ROX-32721: Switch SearchListAlerts and WalkAll to column projection

Replace the blob deserialization path (GetByQueryFn + AlertToListAlert)
with direct column projection via RunSelectDirectFn. All 24 ListAlert
fields are now read from indexed columns using pgtype value types,
avoiding both protobuf deserialization and scany reflection overhead.

Benchmarks show 2-3x latency improvement and ~8x memory reduction
compared to the blob-based approach.

Partially generated by AI.

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

ROX-32721: Add entity type coverage tests for SearchListAlerts projection

Verify that the column projection correctly handles deployment, resource,
and node entity types, including deployment_type, enforcement_count, and
categories array fields.

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!

@dashrews78
Copy link
Copy Markdown
Contributor Author

dashrews78 commented Apr 15, 2026

@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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 15, 2026

🚀 Build Images Ready

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

export MAIN_IMAGE_TAG=4.11.x-667-g1cd7eddaff

dashrews78 and others added 3 commits April 15, 2026 15:19
Replace the blob deserialization path (GetByQueryFn + AlertToListAlert)
with direct column projection via RunSelectDirectFn. All 24 ListAlert
fields are now read from indexed columns using pgtype value types,
avoiding both protobuf deserialization and scany reflection overhead.

Benchmarks show 2-3x latency improvement and ~8x memory reduction
compared to the blob-based approach.

Partially generated by AI.

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

Verify that the column projection correctly handles deployment, resource,
and node entity types, including deployment_type, enforcement_count, and
categories array fields.

Partially generated by AI.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
PostgreSQL stores timestamps with microsecond precision, but protobuf
timestamps have nanosecond precision. Round both expected and actual
timestamps to microsecond before comparing to avoid CI flakiness.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dashrews78 dashrews78 force-pushed the dashrews/migration-32721 branch from c70f096 to 5413be2 Compare April 15, 2026 19:21
@dashrews78 dashrews78 force-pushed the dashrews/projection-read-path-32721 branch from 70d5ded to 1cd7edd Compare April 15, 2026 19:22
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 15, 2026

Codecov Report

❌ Patch coverage is 89.40092% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.66%. Comparing base (5413be2) to head (1cd7edd).

Files with missing lines Patch % Lines
central/alert/datastore/datastore_impl.go 89.40% 23 Missing ⚠️
Additional details and impacted files
@@                     Coverage Diff                      @@
##           dashrews/migration-32721   #20032      +/-   ##
============================================================
+ Coverage                     49.63%   49.66%   +0.03%     
============================================================
  Files                          2767     2767              
  Lines                        208943   209149     +206     
============================================================
+ Hits                         103699   103881     +182     
- Misses                        97555    97585      +30     
+ Partials                       7689     7683       -6     
Flag Coverage Δ
go-unit-tests 49.66% <89.40%> (+0.03%) ⬆️

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