Skip to content

feat(components): mutations over time: do not query mutations if explicit list is given#1100

Open
fhennig wants to merge 4 commits intomainfrom
optimize-mut-over-time-query
Open

feat(components): mutations over time: do not query mutations if explicit list is given#1100
fhennig wants to merge 4 commits intomainfrom
optimize-mut-over-time-query

Conversation

@fhennig
Copy link
Contributor

@fhennig fhennig commented Mar 19, 2026

resolves #1099

Problem

We always query for all mutations in the date range, and also for all their counts and coverage. This is quite an expensive call to make, with the current 200 Million covid sequences, for the whole date range, this takes about 3 seconds. We make this call also if we only request a single mutation.

Solution

The call was done for two reasons:

  1. To get the full list of mutations to query for, in case no explicit list was given by the user
  2. To get the total count and proportion for the mutations

For 1., we still query LAPIS to get the list; there is no way around this. But for 2., we can actually get all this data (counts, coverage) from the mutations-over-time call we make next. This PR does exactly that. Now for user provided mutation lists, we save the API call.

Tests, Screenshots

Some rows are now gone, some added, I skimmed it and it looks good to me. The changes are IMO because the calculations are sometimes slightly differently rounded? Or in some cases the data was edited manually anyways so two API calls don't correlate correctly.

PR Checklist

  • All necessary documentation has been adapted.
  • The implemented feature is covered by an appropriate test.
    • I updated the tests, the numbers show that we're actually aggregating
    • Also one test does an explicit request for include mutations, and there I've removed the API mock for the mutations call, and it is actually not called, which is what we'd expect!

@vercel

This comment was marked as off-topic.

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.

Mutations over time: Mutations call can be omitted if the list of mutations is static

1 participant