Skip to content

Optimize stats-info aggregation queries#395

Merged
Aberdur merged 2 commits into
BU-ISCIII:developfrom
Aberdur:develop
Apr 16, 2026
Merged

Optimize stats-info aggregation queries#395
Aberdur merged 2 commits into
BU-ISCIII:developfrom
Aberdur:develop

Conversation

@Aberdur
Copy link
Copy Markdown
Collaborator

@Aberdur Aberdur commented Apr 16, 2026

PR Description

This PR optimizes the stats-info API used by RELECOV Platform to reduce query overhead and improve response times.

Changes

  • refactor collect_statistics_information() to avoid nested query patterns
  • replace repeated per-value/per-sample counting with bulk queries and in-memory aggregation
  • reduce the number of database hits for both:
    • single-field statistics
    • two-field combined statistics

Why

Some RELECOV Platform pre-processing jobs depend on /wetlab/api/stats-info.

The previous implementation performed multiple nested queries and repeated .count() calls, which could make the endpoint slow and increase the risk of proxy timeouts when requesting statistics for project fields.

@Aberdur Aberdur self-assigned this Apr 16, 2026
@Aberdur Aberdur merged commit 00f9d9d into BU-ISCIII:develop Apr 16, 2026
2 checks passed
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.

2 participants