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

Adds small version of audit_task_interaction table for faster select queries #3545

Merged
merged 1 commit into from
May 13, 2024

Conversation

misaugstad
Copy link
Member

Resolves #1245

Adds a copy of the audit_task_interaction table that holds only a subset of the records (~0.9%), which makes our queries that use records in that table much faster. I used a db dump from Seattle (around 250 million records in the table; 2 million in small version), and the relevant queries went from a runtime of 1 minute 15 seconds to less than 1 second.

Hopefully this will help to reduce load on the db when people use the Explore page! And it should drastically speed up the loading time for the /admin/user pages and the /timeCheck page.

One note is that the evolutions file creates the table, but I am going to manually run the query to copy data into that table. It took 6 minutes to run on my local environment, and I'm worried about what might happen if we do that on the prod servers. The query I'm using is commented out in the evolutions file.

Things to check before submitting the PR
  • I've written a descriptive PR title.
  • I've added/updated comments for large or confusing blocks of code.

@misaugstad misaugstad self-assigned this May 13, 2024
@misaugstad misaugstad merged commit 9937a7d into develop May 13, 2024
@misaugstad misaugstad deleted the 1245-improve-interactions-query-time branch May 13, 2024 19:14
@misaugstad misaugstad mentioned this pull request May 13, 2024
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.

Improve query times for large tables
1 participant