Skip to content

Fix slow repository dashboard with grouped counts - #16

Merged
ewlarson merged 1 commit into
developfrom
feature/dashboard-query-performance
Oct 2, 2026
Merged

ewlarson merged 1 commit into
developfrom
feature/dashboard-query-performance

Conversation

@ewlarson

@ewlarson ewlarson commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

The repository dashboard exceeds the proxy's 30-second timeout because its counts repeatedly scan the resources table for each repository. Calculate harvested counts once per repository and all resource counts in one grouped query, shared by the dashboard and public repository summary endpoint.

Deduplicate tags per resource to preserve the previous array-membership behavior. Keep publication-state precedence, suppressed counts, empty repositories, and latest harvest details unchanged. No database migration or new index is required.

Validation

  • Read-only production benchmark: the new query completed in 666.8 ms across roughly 321,000 resources and 48 repositories.
  • Compared complete old and new query results in the same repeatable-read production snapshot: 48 rows each, zero differences.
  • 7 tests passed, covering repository queries, public API responses, and dashboard HTML rendering. The PostgreSQL 15 regression test covers duplicate/shared tags, publication-state fallback and case handling, missing resources, disabled/empty repositories, and latest-run selection.
  • Ruff and git diff --check passed.

The production benchmark measures database query execution, not end-to-end HTTP latency. This change has not been deployed.

@ewlarson
ewlarson merged commit 6663b90 into develop Oct 2, 2026
3 checks passed
@ewlarson
ewlarson deleted the feature/dashboard-query-performance branch October 2, 2026 21:11
@ewlarson ewlarson mentioned this pull request Oct 2, 2026
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