Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Y25-044 - As a TL (Tom W) I would like to improve the performance of the sample_tracking_view by using cached data so that it is usable by stakeholders. #39

Open
6 tasks
TWJW-SANGER opened this issue Jan 22, 2025 · 0 comments
Assignees

Comments

@TWJW-SANGER
Copy link
Contributor

TWJW-SANGER commented Jan 22, 2025

User story
As a TL (Tom W) I would like to improve the performance of the sample_tracking_view by using cached data so that it is usable by stakeholders.

Who are the primary contacts for this story
Tom W
Laura H

Who is the nominated tester for UAT
Testing can be performed by the development team - see acceptance criteria.

Acceptance criteria
To be considered successful the solution must allow:

  • A table named seqops_tracking_per_plate is created with columns identical to existing sample_tracking_view
  • Indices are created manifest plate barcode, study name and study id columns.
  • A MySQL Event is scheduled to re-populate the seqops_tracking_per_plate table once a day at 1:30 am with the same output as the current sample_tracking_view
  • The existing sample_tracking_view is redefined to "SELECT * FROM seqops_tracking_per_plate" to maintain existing queries while benefiting from the performance boost.
  • The table, event and modified view are present in each environment of in Training, UAT and Prod.
  • The Confluence page "Sample Tracking. Report" updated with new names, performance metrics and implementation details.

Dependencies

This story is blocked by the following dependencies:

Additional context
The current sample_tracking_view takes at least 10 mins to query and has a heavy load on the server.

As part of this story we would like to try using the MySQL Event Scheduler instead of making a view. This is essentially creating 'materialised' view in MySQL.

I have checked this with the DBA's (FS ticket SR-8179) who think it is okay as long as:

Avoid DELETE and prefer TRUNCATE TABLE (See confluence page on MLWH - Guidelines for bulk updates, migrations and performance.)
Be aware of is that all MySQL events have an owner, or more accurately, a definer. When a database is dumped using the mysqldump tool, and the --events option is included, then the dump file includes one or more CREATE EVENT commands to re-create the events in the dumped database. The name of the definer will be included in these commands. If the dump file is then imported into a different MySQL instance, such dumping a production database to import into a test/development instance, then the definer account must exist in the receiving instance, otherwise the CREATE EVENT command will fail, and the entire import will be abandoned, leaving you with a partially-imported database. We may need to work with you to ensure that the weekend cron jobs which re-populate your test/development databases from dumps of the production databases will not fall foul of this.

Consider what, if any, refactoring or re-use we could use with the seq_ops_tracking_per_sample table event SQL.

@TWJW-SANGER TWJW-SANGER added the enhancement New feature or request label Jan 22, 2025
@psd-issuer psd-issuer bot changed the title As a TL (Tom W) I would like to improve the performance of the sample_tracking_view by using cached data so that it is usable by stakeholders. Y25-044 - As a TL (Tom W) I would like to improve the performance of the sample_tracking_view by using cached data so that it is usable by stakeholders. Jan 22, 2025
@TWJW-SANGER TWJW-SANGER moved this from Backlog to Ready in Sample Tracking Report Feb 20, 2025
@khelwood khelwood self-assigned this Mar 11, 2025
@TWJW-SANGER TWJW-SANGER moved this from Ready to UAT in Sample Tracking Report Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: UAT
Development

No branches or pull requests

2 participants