Skip to content

Conversation

@therealbrad
Copy link
Contributor

Description

This PR optimizes data fetching for the test run and session summary pages to improve performance and reduce database load. The changes eliminate N+1 query issues by removing unnecessary field fetching and introducing batch fetching of test run summaries.

Key optimizations:

  • Removed fetching of testCases, tags, issues, and results in the main query to prevent N+1 query issues
  • Created new batch summary API endpoint (/api/test-runs/summaries) for efficient data retrieval
  • Refactored components to utilize pre-fetched summary data
  • Reduced query complexity on the test run listing page

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement

How Has This Been Tested?

Describe the tests you ran to verify your changes:

  • Unit tests
  • Integration tests
  • E2E tests
  • Manual testing

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published
  • I have signed the CLA

Additional Notes

Performance improvements:

  • Eliminated N+1 queries on test run listing page
  • Reduced payload size by removing unused nested relations
  • Batch fetching reduces number of database round-trips
  • Remove UI blocks for entire page. Not page progressive loads as data is available.

…sary fields

- Removed fetching of testCases, tags, issues, and results in the main query to prevent N+1 query issues.
- Introduced batch fetching of test run summaries to improve performance.
- Updated components to utilize pre-fetched summary data where available, enhancing loading efficiency.
@therealbrad therealbrad changed the title Performance/optimize test run summary page queries perf: Performance/optimize test run summary page queries Jan 31, 2026
@therealbrad therealbrad merged commit 64b78a7 into main Jan 31, 2026
4 checks passed
@therealbrad
Copy link
Contributor Author

🎉 This PR is included in version 0.11.13 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants