Skip to content

Y26-181 - Improve nanoseq performance#2879

Open
BenTopping wants to merge 5 commits into
developfrom
Y26-181-improve-nanoseq-performance
Open

Y26-181 - Improve nanoseq performance#2879
BenTopping wants to merge 5 commits into
developfrom
Y26-181-improve-nanoseq-performance

Conversation

@BenTopping

@BenTopping BenTopping commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

SS Story sanger/sequencescape#5839

Changes proposed in this pull request

  • add metadatable_type to metadata lookup to improve query speed
  • Pull all metadata for a request once instead of each request metadata key being a separate query.

Sequencecape PR: sanger/sequencescape#5850

Notes

The main sluggishness comes from the poly_metadata checks and creation.

  • Each polymetadata key / request combo produced a separate request to sequencescape. Since this was not taking advantage of the index of the table this was taking ~1s second per request in UAT.

The changes here allow us to make use of the Sequencescape index on poly_metadata. It also fixes (an unlikely) bug in which we are currently requesting on just metadatable_id which could be the same across classes and doesn't take into account type.
We also reduce N+1 queries by getting all polymetadata for a request at once instead of individually requesting one each time. This could cause issues if a request has mass amounts of polymetadata but I cant see that so far in the existing records.

This process still takes ~20s which isn't ideal but before it was taking ~150s+.

@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.16%. Comparing base (52d3703) to head (95a6b09).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #2879   +/-   ##
========================================
  Coverage    92.16%   92.16%           
========================================
  Files          432      432           
  Lines         9163     9164    +1     
========================================
+ Hits          8445     8446    +1     
  Misses         718      718           
Flag Coverage Δ
javascript 89.37% <ø> (ø)
pull_request 92.16% <100.00%> (+<0.01%) ⬆️
push 92.16% <100.00%> (+<0.01%) ⬆️
ruby 92.58% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

end

it 'raises an error when existing metadata fails to update' do
request_metadata['key1'] = 'new_value1'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how this was passing before as there is a check to ensure update is only called if there is a new value.

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