Skip to content

perf(diagnostics): load providers and group ids with the listing - #157

Merged
lewisjared merged 2 commits into
mainfrom
perf/diagnostics-list-queries
Oct 25, 2026
Merged

lewisjared merged 2 commits into
mainfrom
perf/diagnostics-list-queries

Conversation

@lewisjared

Copy link
Copy Markdown
Contributor

Loads each diagnostic's provider and execution group ids alongside the diagnostics, instead of lazily per diagnostic.

/diagnostics/ and /diagnostics/catalog built every entry with diagnostic.execution_groups, which ran one query per diagnostic and loaded whole rows for their ids. On the fixture database that was 48 of the listing's 56 queries.

  • The provider now joins onto the diagnostic query for all three listings, value-flags included.
  • The group ids load in one selectinload with only the id column, for the listing and the catalog.
  • test_listing_does_not_query_per_diagnostic caps each listing at 10 queries. They now run 6, 4 and 3.

Found through the SQLite spans from #150, where one listing request showed 56 statements.

The listing and catalog lazy loaded each diagnostic's execution groups, one query per diagnostic.
@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 24 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9d780451-588b-42cc-950a-97ca8a17131c
Commits

Reviewing files that changed from the base of the PR and between 7bd72c1 and 83a2e95.

Files selected for processing: 3
  • backend/src/ref_backend/api/routes/diagnostics.py
  • backend/tests/test_api/test_routes/test_diagnostics.py
  • changelog/157.improvement.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@lewisjared
lewisjared marked this pull request as ready for review October 24, 2026 23:15
@lewisjared
lewisjared merged commit 3e1243d into main Oct 25, 2026
6 checks passed
@lewisjared
lewisjared deleted the perf/diagnostics-list-queries branch October 25, 2026 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant