Adds small version of audit_task_interaction table for faster select queries #3545
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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