Skip to content

LIMS-1758: Fix slowness with plates with lots of subsamples#941

Merged
ndg63276 merged 5 commits intopre-release/2025-R3.2from
improvement/LIMS-1758/slowness-with-large-numbers-of-samples
Jun 10, 2025
Merged

LIMS-1758: Fix slowness with plates with lots of subsamples#941
ndg63276 merged 5 commits intopre-release/2025-R3.2from
improvement/LIMS-1758/slowness-with-large-numbers-of-samples

Conversation

@ndg63276
Copy link
Collaborator

@ndg63276 ndg63276 commented May 28, 2025

JIRA ticket: LIMS-1758

Summary:

If a plate has a lot of subsamples, then "Add All to Queue", "Unqueue All", and "Apply to All" buttons become very slow.

Changes:

  • Fix bug where browser complains about slider being set before it exists
  • Show/hide the "Unqueue All" and "Unqueue Selected" buttons depending on whether the plate is queued or not
  • When queuing or unqueuing subsamples, silently update the model (so as to not trigger any GUI changes), then trigger the GUI changes once all queuing/unqueuing is done
  • Modify the "Apply to all" button to show something is happening, return it to normal once the process is done
  • Do "Apply to all" as chunks of 500, to avoid failing on very large numbers of subsamples

To test:

  • Go to /admin/imaging and click on a plate with >500 subsamples, but not too many as it can get very slow (from the containers table)
  • Scroll down and click "Prepare For Data Collection"
  • If any subsamples are already queued, unqueue them using "Unqueue all", check everything is unqueued by this query, it should return zero:
select count(blss.blSubSampleId) from ContainerQueueSample
 inner join BLSubSample blss using (blSubSampleId)
 inner join BLSample bls on bls.blSampleId=blss.blsampleid
 where containerId=<containerId>;
  • Click "Add all to queue", check it only takes a second or two before the page reflects the changes. Check the query now returns the same as the number of subsamples in the plate (as shown on the /admin/imaging page), and the text at the bottom of the page also shows the correct number
  • Click "Unqueue all", check it only takes a second or two before the page reflects the changes. Check the query now returns zero, and the text at the bottom of the page now says "(0 data collections)"
  • Add $preset_proposal = 'cm14559'; to your config.php file to ensure you see about 7 Presets
  • If you have your browser dev console open, turn off "Disable cache" as it significantly slows the next part
  • Click "Add all to queue" again, then choose a one of the Omega Scan presets from the dropdown, and click "Apply to All". Check the button changes to "Applying...", and then changes back to "Apply to all" once it has finished. This takes about a minute for every 500 subsamples.

@ndg63276 ndg63276 marked this pull request as ready for review May 29, 2025 14:30
@gfrn gfrn self-assigned this Jun 9, 2025
@ndg63276 ndg63276 changed the base branch from master to pre-release/2025-R3.2 June 10, 2025 10:30
@ndg63276 ndg63276 merged commit 83936e6 into pre-release/2025-R3.2 Jun 10, 2025
2 checks passed
@ndg63276 ndg63276 deleted the improvement/LIMS-1758/slowness-with-large-numbers-of-samples branch June 10, 2025 10:31
ndg63276 added a commit that referenced this pull request Jun 24, 2025
* LIMS-1758: Fix slowness with plates with lots of subsamples (#941)

* LIMS-1758: Fix slowness with plates with lots of samples

* LIMS-1758: Remove unnecessary change

* LIMS-1758: Remove unnecessary whitespace

* LIMS-1758: Do large updates in chunks

* LIMS-1758: Use native JS

---------

Co-authored-by: Mark Williams <mark.williams@diamond.ac.uk>

* LIMS-1715: Clear sessionId from containers if a dewar transfer is requested (#939)

* LIMS-1715: Clear sessionId from containers if a dewar transfer is requested

* LIMS-1715: Clear sessionId from containers if a dewar transfer is requested

---------

Co-authored-by: Mark Williams <mark.williams@diamond.ac.uk>

* LIMS-1714: Populate Dewar.dewarRegistryId (#936)

Co-authored-by: Mark Williams <mark.williams@diamond.ac.uk>

* LIMS-1701: Make Xray Centring results an openable table (#935)

Co-authored-by: Mark Williams <mark.williams@diamond.ac.uk>

* LIMS-1642: Fix search when clicking x on search bars (#909)

Co-authored-by: Mark Williams <mark.williams@diamond.ac.uk>

* LIMS-1639: List most common screens at the top of the list (#928)

Co-authored-by: Mark Williams <mark.williams@diamond.ac.uk>

* LIMS-1777: Fix download of autoprocessing attachments on sm beamlines (#947)

Co-authored-by: Mark Williams <mark.williams@diamond.ac.uk>

---------

Co-authored-by: Mark Williams <mark.williams@diamond.ac.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants